dear all,
below script of my access project.
im having a problem in my record source how will this run..
pls help.. badly need the searching... thanks in advance. pls pls pls..
error from the Form_frmCustomer_sub.RecordSource = LSQL
Dim LSQL As String
'Display all customers
LSQL = "select * from Customers"
Form_frmCustomer_sub.RecordSource = LSQL
lblTitle.Caption = "Scanner Details: All records"
msgbox "All Scanner are now displayed."
End Sub
Private Sub cmdSearch_Click()
Dim LSQL As String
Dim LSearchString As String
If Len(txtsearchstring) = 0 Or IsNull(txtsearchstring) = True Then
msgbox "You must enter a Scanner serial."
Else
LSearchString = txtsearchstring
'Filter results based on search string
LSQL = "select * from Customers"
LSQL = LSQL & " where ScannerNo LIKE '*" & LSearchString & "*'"
Form_frmCustomer_sub.RecordSource = LSQL
lblTitle.Caption = "Scanner Details: Filtered by '" & LSearchString & "'"
'Clear search string
txtsearchstring = ""
msgbox "Results have been filtered. All Scanner Names containing " & LSearchString & "."
End If
End Sub