I have a database that I have packaged using the package wizard.
I have added the frontend folder location as a trusted site registry key to the package. I have installed this package on several computers with out any runtime errors. I have one satellite office location that gets a runtime error when they open it.
Macro Name: Autoexec
Condition:
Action Name: RunCode
Arguments: OpenCorrectForm()
Error Number: 2001
When the user hits the button "Stop All Macros" which is the only available button, another dialog pops up which says "Execution of this application has stopped due to runtime error."
The autoexec macro calls a function to open an appropriate form based on the users windows login ID.
Here is the code from the module which contains the function
Option Compare Database
Option Explicit
Function GetUserSecLevel() As Integer
GetUserSecLevel = Nz(DLookup("SecurityLevelID", "tblStaff", "[WindowsID]=" & Chr(34) & Environ("username") & Chr(34)), 1)
End Function
Function GetFullUserName() As String
GetFullUserName = Nz(DLookup("FullName", "tblStaff", "[WindowsID]=" & Chr(34) & Environ("username") & Chr(34)), 1)
End Function
Function OpenCorrectForm()
Dim strDoc As String
Dim strUserName As String
strUserName = GetUserName
Select Case GetUserSecLevel
Case 1
strDoc = "GUEST"
Case 2
strDoc = "ERA"
Case 3
strDoc = "TGT"
Case 4
strDoc = "MG2"
Case 5
strDoc = "MCE"
Case 6
strDoc = "HEI"
Case 7
strDoc = "GM"
Case 8
strDoc = "NRA"
Case 9
strDoc = "VAA"
Case 10
strDoc = "MHP"
Case 11
strDoc = "TRC"
Case 12
strDoc = "CTA"
End Select
On Error Resume Next
DoCmd.DeleteObject acForm, "Project List"
DoCmd.DeleteObject acQuery, "goto_qry"
DoCmd.CopyObject , "Project List", acForm, strDoc
DoCmd.CopyObject , "goto_qry", acQuery, strDoc + "_qry"
DoCmd.OpenForm "Project List"
End Function
Any Ideas??
I have added the frontend folder location as a trusted site registry key to the package. I have installed this package on several computers with out any runtime errors. I have one satellite office location that gets a runtime error when they open it.
Macro Name: Autoexec
Condition:
Action Name: RunCode
Arguments: OpenCorrectForm()
Error Number: 2001
When the user hits the button "Stop All Macros" which is the only available button, another dialog pops up which says "Execution of this application has stopped due to runtime error."
The autoexec macro calls a function to open an appropriate form based on the users windows login ID.
Here is the code from the module which contains the function
Option Compare Database
Option Explicit
Function GetUserSecLevel() As Integer
GetUserSecLevel = Nz(DLookup("SecurityLevelID", "tblStaff", "[WindowsID]=" & Chr(34) & Environ("username") & Chr(34)), 1)
End Function
Function GetFullUserName() As String
GetFullUserName = Nz(DLookup("FullName", "tblStaff", "[WindowsID]=" & Chr(34) & Environ("username") & Chr(34)), 1)
End Function
Function OpenCorrectForm()
Dim strDoc As String
Dim strUserName As String
strUserName = GetUserName
Select Case GetUserSecLevel
Case 1
strDoc = "GUEST"
Case 2
strDoc = "ERA"
Case 3
strDoc = "TGT"
Case 4
strDoc = "MG2"
Case 5
strDoc = "MCE"
Case 6
strDoc = "HEI"
Case 7
strDoc = "GM"
Case 8
strDoc = "NRA"
Case 9
strDoc = "VAA"
Case 10
strDoc = "MHP"
Case 11
strDoc = "TRC"
Case 12
strDoc = "CTA"
End Select
On Error Resume Next
DoCmd.DeleteObject acForm, "Project List"
DoCmd.DeleteObject acQuery, "goto_qry"
DoCmd.CopyObject , "Project List", acForm, strDoc
DoCmd.CopyObject , "goto_qry", acQuery, strDoc + "_qry"
DoCmd.OpenForm "Project List"
End Function
Any Ideas??