Good afternoon,
i shall cut to the chass as they say , my form has a list on it and in the list is a list of companys when a company name is pressed it loads the relevent record fine. how ever i wanted to add a company search box so i put a text box in and called it txtsearch, and added a buttion with the following code
this code works fine how ever when i press the buttion and run the code i get a "Enter Parmamaiter Value" msgbox that has what i tyoed in for its value i then have to reenter the search Criteria then hit ok for it to filter the results.
why do i get this box and is there a way to stop it?
also i have debuged the code and i get the msg box on this line of code
Me.lstCustomer.RowSource = strSql
any help you can give would be appricated!
thanks
cybertyk
i shall cut to the chass as they say , my form has a list on it and in the list is a list of companys when a company name is pressed it loads the relevent record fine. how ever i wanted to add a company search box so i put a text box in and called it txtsearch, and added a buttion with the following code
Code:
Private Sub cmdSearch_Click()
Dim strSql As String
strSql = "SELECT tblCustomer.ID, tblCustomer.[Company Name], tblCustomer.Delete FROM tblCustomer WHERE (((tblCustomer.[Company Name]) Like '*' & " & Me.txtSearch.Value & " & '*') AND ((tblCustomer.Delete)=False));"
If Me.txtSearch.Value = Null Then
Me.lstCustomer.RowSource = "SELECT tblCustomer.ID, tblCustomer.[Company Name], tblCustomer.Delete FROM tblCustomer WHERE (((tblCustomer.Delete)=False));"
GoTo foo
Else
Me.lstCustomer.RowSource = strSql
End If
foo:
Me.txtSearch.Value = Null
End Sub
this code works fine how ever when i press the buttion and run the code i get a "Enter Parmamaiter Value" msgbox that has what i tyoed in for its value i then have to reenter the search Criteria then hit ok for it to filter the results.
why do i get this box and is there a way to stop it?
also i have debuged the code and i get the msg box on this line of code
Me.lstCustomer.RowSource = strSql
any help you can give would be appricated!
thanks
cybertyk