Hello Everyone,
So I have a project where I wrote a macro and saved it as AutoExec. I want it to run a few items before the database opens. The first part of the macro is to check if the user has macros enabled so the code works. The second part is to check if the user has permissions to the database. The final step is where I need the help. I searched Google and found numerous ways to do this and I picked this one as it was recommended, but I am getting an error. So on the macro I have it run code to the function and below is the function
It says the function has to many arguments and error 2439. All I am trying to accomplish is check for the table which is named linktable and if it is active then end the function and the macro will open a start up form. If it cannot locate the link then I want a form called "mapp" to open. That will let the user know that the network drive is unavailable and will close the database. It also gives them an option to run an external program. The external program is a BAT file to map the drives when the user logins.
Any help or suggestions? I am also using Access 2013 with reference to the 15.0 object library. Thanks!!
So I have a project where I wrote a macro and saved it as AutoExec. I want it to run a few items before the database opens. The first part of the macro is to check if the user has macros enabled so the code works. The second part is to check if the user has permissions to the database. The final step is where I need the help. I searched Google and found numerous ways to do this and I picked this one as it was recommended, but I am getting an error. So on the macro I have it run code to the function and below is the function
Code:
Public Function IsLink(linktable As String) As Boolean
IsLinked = Nz(DLookup("Type", "MSysObjects", _
"Name='" & linktable & "'"), 0) <> 1
If IsLinked = True Then
Exit Function
Else
DoCmd.OpenReport "mapp"
End If
End Function
It says the function has to many arguments and error 2439. All I am trying to accomplish is check for the table which is named linktable and if it is active then end the function and the macro will open a start up form. If it cannot locate the link then I want a form called "mapp" to open. That will let the user know that the network drive is unavailable and will close the database. It also gives them an option to run an external program. The external program is a BAT file to map the drives when the user logins.
Any help or suggestions? I am also using Access 2013 with reference to the 15.0 object library. Thanks!!