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

How to make my print preview button refresh my form?

Status
Not open for further replies.

OverDrive

IS-IT--Management
Dec 11, 2000
268
0
0
US
Is it possible to add something to the VB side of my "print preview" command button to have it refresh the screen before it goes to print preview mode? This way I do not have to have the user click "Refresh" before they hit "Print Preview"?

Anyone?
Thanks
OD~
 
I figured it out on my own (which is a suprise), for anyone wanting to know how, add the following code inside your print preview code.

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Here is what the full code example will look like.

Private Sub btn_openreport_Click()
On Error GoTo Err_btn_openreport_Click

Dim stDocName As String

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
stDocName = "Account Inquiry"
DoCmd.OpenReport "account inquiry", acPreview, , "[ID] = " & Me.ID

Exit_btn_openreport_Click:
Exit Sub

Err_btn_openreport_Click:
MsgBox Err.Description
Resume Exit_btn_openreport_Click

End Sub

Slowly but surely, I am learning . . .
=)

OverDrive~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top