Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a report from A Form

Status
Not open for further replies.

paul123456

Technical User
Apr 29, 2002
518
US
Say i'm in a form and i am looking at the users information, each page include all of the information of one user. now i want to include a print button that prints the users data that i am looking at in the form to a report (the report is a letter for the user). lets call the form form1 and the report report1. Im not sure what i should use for the event procedure? Thanks, PAUL

 
Hi

Place a button on the form, the wizard will guide you through doing this and will make the basic code for you, but it will include a statement like:

DoCmd.OpenReport ...

you will need to include a 'filter' so that you get only the displayed record, and not all records printed, again the wizard will guide you through this, but for more information look up docmd.openreport in help Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
I don't understand by wizard, nothing comes up how do i activate the wizard. I am just putting a command button on the form but no wizard for help pops up. Thanks, PAUL

 
Hi

On the tool box where you choose the button control from, ensure you have wizard selected (top right icon, looks like a childs magic wand) Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thnx it worked perfectly, hey i was also wondering how i would about making a query so that when i open a report it asks which fields to include (Enter Data Range). for example one of my fields is ID_Num (identification Number) so when i open the report it has two fields and i can enter 100-200 and it will print those records with the ID_Num 100-200? Thanks, PAUL

 
Hi

On the form, from which you run the report, put textboxes to accept the criteria, in your example this would be two text boxes FromId and ToId.

In the query onwhich your report is based, set the criteria to

Id BETWEEN Forms!YourForm!FromId AND Forms!YourFormToId

Again there is a builder wizard to guide you through this

You need use your own form name, control names etc in the bove example. Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top