M
Mark
Hi,
I have a form ("ClassCalendar") with a calendar on it to
allow the user to select a date range and to view
available classes within that date range... upon selecting
a date range (Clicking a command button)... a "class
registration" form is then opened with a list of available
classes to enroll in. On the "ClassRegistration" form I
have the following code (which works fine... please read
my question at the bottom of this page):
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
If IsNull(DLookup("ClassID", "QueryClassesByDate"))_
Then
MsgBox "There are no classes offered within the selected_
date range. Please select another date range or exit_
form.", vbInformation, "Re-enter date range"
DoCmd.Close
Cancel = True
End If
Exit_Form_Open:
Exit Sub
Err_Form_Open:
MsgBox Err.Description
Resume Exit_Form_Open
End Sub
The situation is:
when the user is in the calendar form and selects a date
range with no classes sheduled... the message box pops up
(as in the above code). Fine. But after clicking "Ok"...
another message box appears... it is a standard Microsoft
Access MsgBox that states the following:
"The OpenForm action was canceled."
How can I disable or turn off this message box (to clean
up my database)???
Thanks a million!!!
I have a form ("ClassCalendar") with a calendar on it to
allow the user to select a date range and to view
available classes within that date range... upon selecting
a date range (Clicking a command button)... a "class
registration" form is then opened with a list of available
classes to enroll in. On the "ClassRegistration" form I
have the following code (which works fine... please read
my question at the bottom of this page):
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
If IsNull(DLookup("ClassID", "QueryClassesByDate"))_
Then
MsgBox "There are no classes offered within the selected_
date range. Please select another date range or exit_
form.", vbInformation, "Re-enter date range"
DoCmd.Close
Cancel = True
End If
Exit_Form_Open:
Exit Sub
Err_Form_Open:
MsgBox Err.Description
Resume Exit_Form_Open
End Sub
The situation is:
when the user is in the calendar form and selects a date
range with no classes sheduled... the message box pops up
(as in the above code). Fine. But after clicking "Ok"...
another message box appears... it is a standard Microsoft
Access MsgBox that states the following:
"The OpenForm action was canceled."
How can I disable or turn off this message box (to clean
up my database)???
Thanks a million!!!