MontgomeryPete
Instructor
When a continuous form is opened, the user is requested to enter the relevant date (OnLoad). This form will be open consistently throughout the day. Therefore, the form must be refreshed and there are two forms that the user may wish to reference from a value on the current record.
The problem is that the user is getting the prompt "Enter the Date" on requery or use of the other commmand buttons. I have tried calling the function On Open and On Activate with the same results.
The code is shown below. I would be grateful for any help. Thanks in advance.
...Requery button
Private Sub cmdRequeryDispatchLog_Click()
On Error GoTo Err_cmdRequeryDispatchLog_Click
Dim stDocName As String
stDocName = "qryDispatch"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_cmdRequeryDispatchLog_Click:
Exit Sub
Err_cmdRequeryDispatchLog_Click:
MsgBox Err.Description
Resume Exit_cmdRequeryDispatchLog_Click
...Vehicle Assignment button
Private Sub cmdAssignment_Click()
On Error GoTo Err_cmdAssignment_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAssignments"
stLinkCriteria = "[VehicleNo]=" & Me![VehicleNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdAssignment_Click:
Exit Sub
Err_cmdAssignment_Click:
MsgBox Err.Description
Resume Exit_cmdAssignment_Click
End Sub
...Driver Status button
Private Sub cmdStatus_Click()
On Error GoTo Err_cmdStatus_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmDriversStatus"
stLinkCriteria = "[VehicleNo]=" & Me![VehicleNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdStatus_Click:
Exit Sub
Err_cmdStatus_Click:
MsgBox Err.Description
Resume Exit_cmdStatus_Click
End Sub
The problem is that the user is getting the prompt "Enter the Date" on requery or use of the other commmand buttons. I have tried calling the function On Open and On Activate with the same results.
The code is shown below. I would be grateful for any help. Thanks in advance.
...Requery button
Private Sub cmdRequeryDispatchLog_Click()
On Error GoTo Err_cmdRequeryDispatchLog_Click
Dim stDocName As String
stDocName = "qryDispatch"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_cmdRequeryDispatchLog_Click:
Exit Sub
Err_cmdRequeryDispatchLog_Click:
MsgBox Err.Description
Resume Exit_cmdRequeryDispatchLog_Click
...Vehicle Assignment button
Private Sub cmdAssignment_Click()
On Error GoTo Err_cmdAssignment_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAssignments"
stLinkCriteria = "[VehicleNo]=" & Me![VehicleNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdAssignment_Click:
Exit Sub
Err_cmdAssignment_Click:
MsgBox Err.Description
Resume Exit_cmdAssignment_Click
End Sub
...Driver Status button
Private Sub cmdStatus_Click()
On Error GoTo Err_cmdStatus_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmDriversStatus"
stLinkCriteria = "[VehicleNo]=" & Me![VehicleNumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdStatus_Click:
Exit Sub
Err_cmdStatus_Click:
MsgBox Err.Description
Resume Exit_cmdStatus_Click
End Sub