I have an employee table that I would like the user to fill in if the Employee ID is not found in the table.
I am having a problem with setting up the loop properly.
I need it to wait for the user to press the "save & Close Button" on the form before rechecking for the EmployeeID.
Thanks
John Fuhrman
I am having a problem with setting up the loop properly.
I need it to wait for the user to press the "save & Close Button" on the form before rechecking for the EmployeeID.
Code:
Private Sub Form_Load()
On Error GoTo Err_Handler
Do While IsNull(DLookup("EmployeeID", "tblEmployee", "EmployeeID=" & "'" & fOSUserName & "'"))
MsgBox ("Employee ID not found." & vbCrLf & _
"Please enter your Information.")
DoCmd.OpenForm "frmEmployees", acNormal, , , acFormAdd, acWindowNormal
Loop
' ShowDbWindow (False)
Me.btnMailroomMenu.Visible = False
Me.btnOperationsMenu.Visible = False
If IsMember(GetCurrentDomain, "NRC Mailroom SQL Users - CIS", fOSUserName) = True Then
Me.btnMailroomMenu.Visible = True
ElseIf IsMember(GetCurrentDomain, "NRC CENTOPS - CIS", fOSUserName) = True Then
Me.btnOperationsMenu.Visible = True
Me.btnMailroomMenu.Visible = True
ElseIf IsMember(GetCurrentDomain, "NRCITS-CIS", fOSUserName) = True Then
Me.btnOperationsMenu.Visible = True
Me.btnMailroomMenu.Visible = True
Dim result As String
result = MsgBox("Open the Database Window?", _
vbInformation + vbYesNo, "Access DB Window")
Select Case result
Case 1, 4, 5, 6 'yes
ShowDbWindow (True)
Case 2, 3, 7 'No
ShowDbWindow (False)
End Select
Else
'Do Nothing
End If
endit:
Exit Sub
Err_Handler:
If StandardErrors(Err) = False Then
BeepWhirl
MsgBox Err & ": " & Err.Description
End If
Resume endit
End Sub
Thanks
John Fuhrman