hello there,
I would like to know how to do a validation check, so that if a person chooses a particular option from a drop down menue and no information was written about that particular company, a message would appear stating that no information was entered regarding that company therefore the a report would not pop up. The client would be using a search form, to choose the company they want to find out information about........... I got everything else working already and even tho it seems like a small problem its giving me a lot of trouble.
Here is the code i have already:
Who ever can help me out i would really appreciate it.........
I would like to know how to do a validation check, so that if a person chooses a particular option from a drop down menue and no information was written about that particular company, a message would appear stating that no information was entered regarding that company therefore the a report would not pop up. The client would be using a search form, to choose the company they want to find out information about........... I got everything else working already and even tho it seems like a small problem its giving me a lot of trouble.
Here is the code i have already:
Code:
Private Sub Command4_Click()
Dim pstrCriteria As String
If IsNull([txtSearch]) Then
MsgBox " Please enter search criteria"
Else
'If legal Company Name entered, form criteria, and print
If txtSearch <> " " Then
pstrCriteria = "[CompanyName] = " & Chr$(34) & txtSearch & Chr$(34)
DoCmd.OpenReport "Ideal Optical Business Solutions", acViewPreview, , pstrCriteria
End If
End If
End Sub
Who ever can help me out i would really appreciate it.........