If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Command button to create reports and export files

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Jul 2003
Posts: 6
Command button to create reports and export files

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.

Are there ways to do things like these in Access?

Gurka
Reply With Quote
  #2 (permalink)  
Old
Cavalier King Charles
 
Join Date: Dec 2002
Location: Préverenges, Switzerland
Posts: 3,739
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.

izy
Reply With Quote
  #3 (permalink)  
Old
Cavalier King Charles
 
Join Date: Dec 2002
Location: Préverenges, Switzerland
Posts: 3,739
the second thing: yes!

use .SNP if you want to preserve formatting. an example:

DoCmd.OutputTo acOutputReport, "reportName", "Snapshot Format", "drive:/path/path/filename.SNP"

you'll find lots of options in .OutputTo


izy
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Jul 2003
Posts: 6
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?

Gurka
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: Jul 2003
Posts: 25
Wink

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)




Phil
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On