R
Ron
My MDB runs a switchboard form on startup. The "on open"
for the switchboard has the code below. Basically, if
the person signing on is a supervisor, it closes the
regular switchboard and opens the supervisor's
switchboard.
The problem is that occasionally, the code doesn't fire
and the sysadmin will wind up with the regular
switchboard. If sysadmin immediately closes and re-opens
the mdb it usually opens correctly.
But how can I get it to consistently open correctly? The
supervisor is going to get honked off if she has to open
it twice to get the correct switchboard.
Private Sub Form_Open(CANCEL As Integer)
If (CurrentUser() = "Sysadmin" Or CurrentUser()
= "rturner") Then
DoCmd.Close
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_SupervisorSwitchboard"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
DoCmd.Maximize
End If
End Sub
for the switchboard has the code below. Basically, if
the person signing on is a supervisor, it closes the
regular switchboard and opens the supervisor's
switchboard.
The problem is that occasionally, the code doesn't fire
and the sysadmin will wind up with the regular
switchboard. If sysadmin immediately closes and re-opens
the mdb it usually opens correctly.
But how can I get it to consistently open correctly? The
supervisor is going to get honked off if she has to open
it twice to get the correct switchboard.
Private Sub Form_Open(CANCEL As Integer)
If (CurrentUser() = "Sysadmin" Or CurrentUser()
= "rturner") Then
DoCmd.Close
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_SupervisorSwitchboard"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
DoCmd.Maximize
End If
End Sub