View Full Version : search boxes


jprma
12-07-2001, 11:36 AM
Hi friends, I am back for help. In my database (MS ACCESS 97) I have a form named frmQueries on to which I have added a TAB CONTROL which has 5 pages. The first page is named ALPHA. On this page I have added various text boxes into which the user can type the criteria to search. To run the query, I have created for each text box a command button which makes the query run.
Obviously the query itself has the following criteria:
Like "*" & [forms]![frmQueries]![txtsearch1] & "*"
frmQueries is the form and txtsearch1 is the name of the text box into which type the information.
Do you think is possible to use just one command button for all the text boxes? How could I associate all the events to one, unique button?
Thanks

Leo J
12-07-2001, 01:31 PM
If the search strings are mutually exclusive, you could upon one field getting the focus, make the other search fields "" and when the user pressed the command button you can check withone of your queries to run. If the search can be combined, you will have to do your query by SQL string and concatenate all of the search strings together. You would have to do all this in VBA, the code behind the buttons.

jprma
12-07-2001, 11:24 PM
Thanks for your help, but I don't think that I will be able to write such a code, it outside my expertise. Is there any change you can help me? Thanks

Jack Cowley
12-08-2001, 09:14 AM
This article should help you in your quest...

http://support.microsoft.com/support/kb/articles/Q210/2/42.ASP?LN=EN-US&SD=gn&FR=0&qry=QBF&rnk=2&src=DHCS_MSPSS_gn_SRCH&SPR=ACC2000