Colin
Colin

Reputation: 339

Print a Record in Landscape

I have created a database, and now want to have a 'Print' button that allows the user to Print the current record selected, however, my database is layed out in Landscape format.

My question is how can I go about creating this button to print my record in Landscape mode? I've read a few places that you have to swap the Form into a Record before being able to do this?

Any help would be greatly appreciated!

Thanks!

Upvotes: 0

Views: 1446

Answers (2)

SendETHToThisAddress
SendETHToThisAddress

Reputation: 3744

You said "I've read a few places that you have to swap the Form into a Record before being able to do this?" Actually you can just print the form if you like. You can use this code:

Forms(Me.Form.Name).Printer.Orientation = acPRORLandscape
DoCmd.OpenForm Me.Form.Name, acPreview

Which will open a print preview of the current form. Or if you really do want to print a record (not the form) you can do something like this:

Reports(me.CurrentRecord).Printer.Orientation = acPRORLandscape

You can also use a string literal or variable in place of me.CurrentRecord.

Upvotes: 1

Internet Engineer
Internet Engineer

Reputation: 2534

It should be easy, just change the page orientation:

http://www.dreamincode.net/forums/topic/44150-printing-in-vbnet/

Upvotes: 0

Related Questions