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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding ONE record from a Form to Report and print it

Status
Not open for further replies.

0200050

Programmer
Jun 3, 2003
58
FI
Hi everyone.

Im having a bit confusing problem. This might be easy to someone but its still too complicated to me. Thats why I would like to ask this from you.

First of all, im trying to do following: Print a report, which has some information that are basing on a form. When I press a button on a form, it should open a report, and print the form's information by using report. (Of course i dont see when it opens the report, it could have a macro that would do it.)

By myself i think i should create a report first. Then i guess i would need to add same the information to the report that i already had in form?

But the problem comes when im trying to leave that report empty; if I add some textboxes that are having the same value than any of form's textboxes has, it shows many records in print preview.

Printing different Records FROM a form is all what i am attempt to do. Those records only should be added in a report...But i would like only ONE record by time, because when the User is doing something with the form, he/she only sees a one particular record, which he/she wants to get printed.

If anyone has any thought of what im trying to ask, i would be really pleased if someone would inform me.

Thank you very much in advance,

From Michael

 
In the DoCmd.OpenReport method, there is a parameter for a Where condition. Here you can reference the Record's ID (assuming you have a unique identifier for each record).

This would be the basic form of the command


DoCmd.OpenReport "MyReport", , , "RECID = " & Me.RECID

Hope this helps.

lonniejohnson@prodev.us
ProDev, MS Access Applications B-) ,
May God bless you beyond your imagination.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top