Print Current Form (1 Viewer)

JPR

Registered User.
Local time
Yesterday, 17:48
Joined
Jan 23, 2009
Messages
192
Hello,

I have a form with two tab pages. One picks data from a table, the second one has unbound fields that once updated are saved into a different table.

I am having problems in printing this second page.

I have tried two options:

1) The following command: DoCmd.PrintOut acSelection

2) The following code: Dim myform As Form
Dim pageno As Integer
pageno = Me.CurrentRecord
Set myform = Screen.ActiveForm
DoCmd.SelectObject acForm, myform.Name, True
DoCmd.PrintOut acPages, pageno, pageno, , 1
DoCmd.SelectObject acForm, myform.Name, False

IN both cases, I am able to print but the tabs get stuck and cannot move from one to the other.

Will appreciate any help. Thank you
 

isladogs

MVP / VIP
Local time
Today, 01:48
Joined
Jan 14, 2017
Messages
18,209
Forms are designed for screen display not for printing. Suggest you use a report
 

JPR

Registered User.
Local time
Yesterday, 17:48
Joined
Jan 23, 2009
Messages
192
Thank you for your reply.
But will I be able to create a report based on unbound fields?
 

isladogs

MVP / VIP
Local time
Today, 01:48
Joined
Jan 14, 2017
Messages
18,209
By definition, fields can't be unbound. I assume you mean unbound controls.

Perhaps surprisingly yes you can print a report based on unbound controls ... though its not often done.
Click on your form then select File...Save Object As... Report.
The report will include unbound objects including tab controls when in report view. But here's the rub....not everything is displayed in print preview so may not meet your needs.
The question might be why would you need to print unbound form controls as an Access report
 

Users who are viewing this thread

Top Bottom