helloworld
Registered User.
- Local time
- Yesterday, 16:25
- Joined
- May 18, 2004
- Messages
- 62
Hi there,
The code below takes an option from a combobox and puts it in a criteria for a query in order to filter it to whatever option the user clicks on. Could someone please help me to add on to the code so that if the option the user clicks is not in the query/table a message box pops up and displays a message. Thanks.
This is the code I have so far (this code works)
Private Sub Open_report_Click()
On Error GoTo Err_Open_report_Click
Dim stDocName As String
stDocName = "Reports"
DoCmd.OpenReport "Reports", acPreview, , "[NameoffieldIwanttosetcritieriato]Like forms!Reports![nameofcombobox]"
Exit_Open_report_Click:
Exit Sub
Err_Open_report_Click:
MsgBox Err.Description
Resume Exit_Open_report_Click
End Sub
The code below takes an option from a combobox and puts it in a criteria for a query in order to filter it to whatever option the user clicks on. Could someone please help me to add on to the code so that if the option the user clicks is not in the query/table a message box pops up and displays a message. Thanks.
This is the code I have so far (this code works)
Private Sub Open_report_Click()
On Error GoTo Err_Open_report_Click
Dim stDocName As String
stDocName = "Reports"
DoCmd.OpenReport "Reports", acPreview, , "[NameoffieldIwanttosetcritieriato]Like forms!Reports![nameofcombobox]"
Exit_Open_report_Click:
Exit Sub
Err_Open_report_Click:
MsgBox Err.Description
Resume Exit_Open_report_Click
End Sub