Ok, I have been trying to figure this out all day and can't seem to place my finger on what I'm doin wrong. I am using Access
2000 (unfortunately the only thing available on my work computer) I have a simple database that has a Table containing fields
such as Last Name, First Name, etc. I have made a Form called FormSearch that I placed some text boxed on called txtFirst and
txtLast. I made a Query and added the appropriate fields that I want to query. in the criteria portion I have placed this:
Like Like "*" & [Forms]![FormSearch]![txtLast] & "*".
When I run the query a "Enter Parameter Value" box appears instead of using the data inputed in the text box on the
FormSearch form. When i do use the "Enter Parameter Value" box to search a last name or any part of the last name it does
however work. If left blank it shows all records as expected.
Once this didn't I would try using the "Enter Parameter Value" box rather than using text boxes. To do this though I created
two separate queries, called QueryLast and QueryFirst,to run the search. I figured I would give the user a choice at which
one to run by putting two different buttons on the form, called cmdLast and cmdFirst. When trying to run the already working
queries from a button, this was the result:
In the command button wizard I selected Miscellaneous, then run query. I selected the appropriate query. When I try to run
the query from the button I get this message:
"The expression On Click you entered as the event property produced the following error: A problem occured while Microsoft
Office Access was communicating with the OLE or ActiveX Control
*The expression may not result in the name of a macro, the name of a user-defined function, or [Event Proceedure]
*There may have been an error evaluating the function, event, or macro."
I would much rather be able to run a single search query from multiple text boxes on my form as I was trying to at the
beginning. This allows the user the easiest searching method, although If I cold get the multiple button/ multiple query
method I was trying to work I would also resort to that as well. I have seen a tutorial online showing the same criteria in
the query that I used, in each search field, and changing the names of the respective text box in each one and it always
worked just fine. I have followed everything to the "T" and I can't seem to figure out what is wrong.