
I'm trying to find the best way to do the following:
1. the user select desired search option from the option group (opgSearchOption) - see 1st attachment
2. Validate at least one characteristic has been entered in Search Box (txtSearch)
3. when the user click Search button, open the form called frmParentMapEntrysearch (see 2nd attachment) and show the search result
Here is what i have for now:
Private Sub btnSearch_Click()
'1. Declare Variables
Dim strSearch As String
'2. Validate that at least 1 character has been entered for the search
If IsNull(strSearch) Then
MsgBox "Please enter search values of the search options you have selected"
End If
'3. Input variable
strSearch = txtSearch.Text
'4. Search and find the customer for corresponding search option
If opgSearchOption = 1 Then
DoCmd.OpenForm "frmParentMapEntry", acNormal, "strSearch = " & [CUSTOMER_NAME]
End If
If opgSearchOption = 2 Then
DoCmd.OpenForm "frmParentMapEntry", acNormal, "strSearch = " & [CUSTOMER_SID]
End If
If opgSearchOption = 3 Then
DoCmd.OpenForm "frmParentMapEntry", acNormal, "strSearch = " & [CUSTOMER_NUMBER]
End If
End Sub
Seems like there are many problems with my code.:banghead: Anyone any ideas?
Thank you!