multi search in access 2007

asama-san

New member
Local time
Today, 23:06
Joined
Jul 24, 2010
Messages
6
i need help this search code work fine to one search but i want to make it multi search ( cboSearchField ,cboSearchField1)(txtSearchString,txtSearchString1)

Private Sub cmdSearch_Click()
If Len(cboSearchField) = 0 Or IsNull(cboSearchField) = True Then

MsgBox "You must select a field to search."

ElseIf Len(txtSearchString) = 0 Or IsNull(txtSearchString) = True Then

MsgBox "You must enter a search string."

Else

strField = UCase(cboSearchField.Value)
strSrchStr = UCase(txtSearchString.Value)



'Filter Employee based on search criteria

Form_frmEmployee.RecordSource = "SELECT * FROM Employee WHERE [" & strField & "] Like '*" & strSrchStr & "*'"



'Close frmSearch
DoCmd.Close acForm, "frmSearch"

MsgBox "Results have been filtered."

End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom