Hello I am receiving this error from the Form_AssestsList.RecordSource = "select * from Assests where " & GCriteria line below
Thanks for the help
Curtis
Thanks for the help
Curtis
Code:
Option Compare Database
Private Sub cmdClose_Click() 'Close form
DoCmd.Close
End Sub
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
'Generate search criteria
GCriteria = cboSearchField.Value & " LIKE '*" & txtSearchString & "*'" 'Filter frmCustomers based on search criteria
Form_AssestsList.RecordSource = "select * from Assests where " & GCriteria
Form_AssestsList.Caption = "Assests (" & cboSearchField.Value & " contains '*" & txtSearchString & "*')"
'Close frmSearch
DoCmd.Close acForm, "frmSearch"
MsgBox "Results have been filtered."
End If
End Sub
Last edited by a moderator: