I have a form with a textbox called txtZipCode, where the user will put in a zipcode. I then have a command button that they can click in order to view a report. I want the report that they will view to be based on a certain table and only include the zip code that the user typed in. I don't think that the command button wizard will do all this for me. I am thinking I might have to have two buttons. One to create the query and one to create the report?
The second thing I want to do is to create a button that will export the report to a place that the user specifies into a format that he/she specifies, for example .csv.
your report is based on a query.
the query includes the zipcode field
open the query design grid; click once in the criteria box in the zipcode column; click the "magic-wand" builder in the main menu bar: in the left pane navigate: forms¦all forms¦your form; and then double-click the txtZipCode field in the right pane.
your query now uses the zipcode on your form to provide criteria.
Thanks, I got it to work. Now I need to get more than one zip code in the textbox and for it to show up in the report. I thought it would work since I can put in the criteia field something like: "75000" or "75001" or "75002" and it will work, but that didn't work in the textfield.
Can you help me?
Try *77200* in your text box and then it should work.
If you do not want to type * all the time, then create another text box that = *your original text box* and run the query off the new text box you have created. Make sure you hide the text box in functionality use, cheers.
Then one you user enters 784940 the new text box will be *784940* and so it will work.
(make sure in your criteria box in the query that you put Like(your text box) etc)