Is there a way to determine the Object type, when passing a reference to a function?
I'm using a security permissions function, which determines if the user has permission to view/edit the Form passed to it by reference. I'd like to expand this to include reports as well.
To keep the function generic, I'd like to pass a ref for either a Form or a Report as an Object, eg:
function gfSecurity_Permission(obj as Object)
但是,我需要确定type函数中的对象.
有谁知道这样做的方法?
MTIA
自从我使用Access代码以来已经有好几年了,这让我觉得自己很疯狂.
我只是不记得任何事情,我想要做的就是在代码中打开一个记录集,我在网上找不到任何内容,或者我尝试过的任何代码排列.
缺点:
Dim rsSystem As Recordset
Dim sSQL As String
sSQL = "SELECT * FROM Table"
Set rsSystem = CurrentDB.OpenRecordset(sSQL)
Run Code Online (Sandbox Code Playgroud)
我错过了什么神圣的地狱?
提前致谢.