Hello,
I would appreciate your help in solving this issue.
1I was thinking to redesign a search form and remove the multiple search boxes and buttons and just leave one of each.
My form will have:
- 1 combo box (cboqueries) which will display the names of the queries
- 1 search textbox (txtsearch) in which users will type the criteria
- 1 cmd button (cmdsearch) that will run the specific query
- 1 list box (lstsearchresults) which will display the query results
I have written this code but only works for the first query. When I change the query from the cbo box and get the No records found message.
Thank you for your help.
I would appreciate your help in solving this issue.
1I was thinking to redesign a search form and remove the multiple search boxes and buttons and just leave one of each.
My form will have:
- 1 combo box (cboqueries) which will display the names of the queries
- 1 search textbox (txtsearch) in which users will type the criteria
- 1 cmd button (cmdsearch) that will run the specific query
- 1 list box (lstsearchresults) which will display the query results
I have written this code but only works for the first query. When I change the query from the cbo box and get the No records found message.
Code:
If Me.cboqueries.Value = "FILENO" Then
Me.lstsearch.RowSource = "qryFILENO"
else
MsgBox "Sorry, no records were found.", vbInformation, "Test Search Menu"
Me.txtsearch.Value = Null
Me.txtsearch.SetFocus
End If
If Me.cboqueries.Value = "LASTNAME" Then
Me.lstsearch.RowSource = "qryLASTNAME"
else
MsgBox "Sorry, no records were found.", vbInformation, "Test Search Menu"
Me.txtsearch.Value = Null
Me.txtsearch.SetFocus
End If
If Me.cboqueries.Value = "FIRSTNAME" Then
Me.lstsearch.RowSource = "qryFIRSTNAME"
else
MsgBox "Sorry, no records were found.", vbInformation, "Test Search Menu"
Me.txtsearch.Value = Null
Me.txtsearch.SetFocus
End If
Thank you for your help.