I have a form and a subform. The form contains a combobox I want the end-user to use to search with. The subform contains what will be displayed when the end-user searches. The combobox is bound to the table as are the subform items. I have it displayed as a formview and not datasheet because the items being returned are too much for the screen so I want it to look nice and neat. It does not return anything when I search and I think it has something to do with the txtsearchstring portion. Also, how does the end-user without doing this in a datasheet click something to get to the next record until they get to the record they are looking for?
I am not sure how to modify my code to make it work. Here is my code:
Code:
Private Sub Search_Click()
Dim LSQL As String
Dim LSearchString As String
If Len(txtSearchString) = 0 Or IsNull(txtSearchString) = True Then
MsgBox "You must select a Measure or go back to the Main Menu."
Else
LSearchString = txtSearchString
LSQL = "select * from Measure"
lqsl = LSQL & " where Measure like '*" & LSearchString & "*'"
txtSearchString = ""
MsgBox "Results are displayed."
End If
End Sub