J
James
I have a form that has one combo box with all of the employee's in it, and
later will add a date range. When I select the employee from the list and
then hit the view report button nothing is diplayed and no error messages.
If I don't have an employee in it it shows the error message to select the
employee like I want. The code is below for both the form and the report.
This is from the Form:
Private Sub btnDriver_Click()
If IsNull([cmbDriver]) Then
MsgBox "You must select a driver's name from the list."
DoCmd.GoToControl "cmbDriver"
Else
Me.Visible = False
End If
End Sub
This is from the report:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There is no data for this report. Canceling report..."
Cancel = -1
End Sub
Private Sub Report_Close()
DoCmd.Close acForm, "frmDriver"
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmDriver", , , , , acDialog, "Driver"
If Not IsLoaded("Driver") Then
Cancel = True
End If
End Sub
later will add a date range. When I select the employee from the list and
then hit the view report button nothing is diplayed and no error messages.
If I don't have an employee in it it shows the error message to select the
employee like I want. The code is below for both the form and the report.
This is from the Form:
Private Sub btnDriver_Click()
If IsNull([cmbDriver]) Then
MsgBox "You must select a driver's name from the list."
DoCmd.GoToControl "cmbDriver"
Else
Me.Visible = False
End If
End Sub
This is from the report:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There is no data for this report. Canceling report..."
Cancel = -1
End Sub
Private Sub Report_Close()
DoCmd.Close acForm, "frmDriver"
End Sub
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "frmDriver", , , , , acDialog, "Driver"
If Not IsLoaded("Driver") Then
Cancel = True
End If
End Sub