I have created a form to search a sub_form, but with the code im useing im getter run-time error 424: Object required.. can someone let me know where im going wrong?
Private Sub Command5_Click()
Dim LSQL As String
Dim LSearchString As String
If Len(txtSearchString) = 0 Or IsNull(txtSearchString) = True Then
MsgBox "You must enter a search string."
LSearchString = txtSearchString
'Filter results based on search string
LSQL = "select * from [Employer Profile - Master Table]"
LSQL = LSQL & " where [Business Name] LIKE '*" & LSearchString & "*'"
[Form_Employer Profile - Master Form].RecordSource = LSQL
lblTitle.Caption = "Customer Details: Filtered by '" & LSearchString & "'"
'Clear search string
txtSearchString = ""
MsgBox "Results have been filtered. All Company Names containing " & LSearchString & "."