Create report from form

Bob Paul

New member
Local time
Yesterday, 21:47
Joined
Nov 21, 2008
Messages
8
I have an access 2002 application where people can use a form to create a new record in the table. They would like to have a button on the form that would print a report of the record they are just now creating. The report would include data elements from this form, plus data elements from other related tables.

If this doesn't make sense, I will create a more specific example.
Regards,
BP
 
Thats great, let us know how it goes.

Excuse the rudeness, but if you want help, well, first, you need to try and figure it out yourself. If you need help from us here, you actually need to post a question. Not just state your objective and hope somebody does it for you.

Create the report.
Create the button on the form.
In the on click event of the button, add the code
Code:
docmd.openreport "YourReportNameHere",acnormal,,,id=&"me.id"
 
Thats great, let us know how it goes.

Excuse the rudeness, but if you want help, well, first, you need to try and figure it out yourself. If you need help from us here, you actually need to post a question. Not just state your objective and hope somebody does it for you.

Create the report.
Create the button on the form.
In the on click event of the button, add the code
Code:
docmd.openreport "YourReportNameHere",acnormal,,,id=&"me.id"

Speakers_86:

Close, but slightly off:

Code:
DoCmd.OpenReport "YourReportNameHere", acViewPreview,,"ID=" & Me!ID

You had an extra comma and your quotes were in the wrong place for the ID= part.
 
Also, acNormal will print the report immediately, acViewPreview will let you look before printing.
 
I know enough to be dangerous! That was from memory though, in practice I would have got that after a try or two. Or referenced one of the other times I have used that code.

Thanks for the watchful eye. ;)

BTW, I guessed the number of commas. So I figured it would be slightly off. I didnt think that it mattered much, this guy needs to figure SOMETHING out on his own. I mean, its not like this is something that can be found on google or anything.
 
Start from the begining

you need a qry with th e data in it and fromt here its nice and easy
 
Thank you very kindly. You gave me the useful (and accurate) information that allowed me to accomplish the task. Kind regards, BP
 

Users who are viewing this thread

Back
Top Bottom