Printing Current record (1 Viewer)

Garcimat

Member
Local time
Tomorrow, 07:32
Joined
Jun 7, 2022
Messages
67
Hi guys
When I finish to collect the data in a form, I make the button to save the data available, I save the data as a new record, close the form and open a first page form….
I need to print only this “form” record. I have tried docmd.printout and current but prints all the records from the data table.
Is there a way to print only the current record that is showing in my form ?
I was thinking in save the record collect some unique values (SWO_Number and PTF_Number or Max ID value) in global variables and use a sql query and then print it, but I don’t know how to do it.
Thanks in advance
 

theDBguy

I’m here to help
Staff member
Local time
Today, 14:32
Joined
Oct 29, 2018
Messages
19,211
Have you tried using a report? When you print a report, you can specify only one record to print.
 

Garcimat

Member
Local time
Tomorrow, 07:32
Joined
Jun 7, 2022
Messages
67
That would work if I could use a global var as criteria in the query… Or get the highest ID (auto number field)
I don’t know how to do this
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 17:32
Joined
Feb 19, 2002
Messages
36,974
If you are printing from the current form, you have the autonumber that was just generated. Use it in the OpenReport's where argument.

Technically, you can print forms but only if they are single record. Subforms will not paginate like they do in a report. Also, forms tend to be colorful and take a lot more ink to print than reports so most people just make a report and print that.
 

Users who are viewing this thread

Top Bottom