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

Print Buttons on Forms.

Status
Not open for further replies.

BruceJackson

Technical User
Apr 30, 2003
29
GB
I can print selected record on a form using a macro but how can I print in landscape automatically.
 
Consider creating a Report with the data on the form as the data source. Use the Report Wizard if u are not familiar with creating reports. Once the report is created and configured for Landscape, test it. It will show All records within the table.

On the form, create a button (again, via the wizard) to open a report form. Once that is created, you can modify the code behind the button to filter the data on the report to only the current record displayed on the form.

Psuedo code---
Dim stDocName As String
Dim lcWhere As String
If Me.cbo_UserGroup.Value = "ALL" Then
lcWhere = ""
Else
lcWhere = "USERGROUP ='" & Me.cbo_UserGroup.Value & "'"
'above I am using a value in a Combobox, u
'can also use a text field, etc.
End If
stDocName = "rpt_User_List" 'Report Form Name
DoCmd.OpenReport stDocName, acPreview, , lcWhere
-------

htwh,


Steve Medvid
"IT Consultant & Web Master"
e-Mail: Stephen_Medvid@GMACM.com

Chester County, PA Residents
Please Show Your Support...
 
I would agree with smedvid. I generally create reports to print the contents of the form (forms never seem to look as good on paper as they do on the screen). However, to do what you want (without creating a report), in form design view, select File|Page SetUp..., then select the Page tab and change Orientation to Landscape.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top