Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Print Dialog disappears in Runtime

1 view
Skip to first unread message

B Mell

unread,
Feb 22, 1999, 3:00:00 AM2/22/99
to
HELP!
I have a custom toolbar for my reports, with a
print dialog icon on it, but when I run the app
in Runtime, (Access97) it disappears. I can get
print, print setup, but not the print dialog box
which allows the users to select pages to print.

Any help would be appreciated.
-Mary Jane
bm...@earthlink.net


Marina Whall

unread,
Feb 22, 1999, 3:00:00 AM2/22/99
to
I know there is a way to handle this through code, but the following
solution worked so well for my users that I never tracked down the code: I
just taught them to use the key combination "Ctrl + P". Works great, from
all reports, in my runtime application.

Marina


B Mell wrote in message <36D1C2E3...@earthlink.net>...

Terry Wickenden

unread,
Feb 23, 1999, 3:00:00 AM2/23/99
to
The following is from my Web Site and should give you what you want

Print Dialog in Runtime Environment

When you build a custom menu bar in Microsoft Access 97 and include the
built-in File menu, some commands do not appear on the menu in the run-time
environment. For example, the Print command does not appear on the menu; as
a result, you cannot modify the printer settings or properties. You can
create a Microsoft Visual Basic for Applications function that displays the
Print dialog box and attach that function to a custom Menu Bar. For more
information see Article 173796 on the Microsoft Knowledge Base

'***************** Code Start *******************
'Code from Microsoft Knowledge Base

Public Function PrintOut()
' Attached to a custom Print command on a custom menu bar.
' Use the RunCommand method to display the print dialog box.
On Error GoTo ErrorTrap
DoCmd.RunCommand acCmdPrint
Exit Function
ErrorTrap:
' Check whether the RunCommand method was canceled.
' If RunCommand is canceled, it generates a trappable run-time error
(2501).
If Err.Number = 2501 Then
Exit Function
Else
MsgBox Err.Number & vbCRLF & Err.Description
End If
End Function

'****************** Code End ********************


--

Hope this helps

Terry Wickenden

Remove access from my E-mail to gain access

RunCommand Constants : - http://www.tkwickenden.clara.net

B Mell

unread,
Feb 23, 1999, 3:00:00 AM2/23/99
to
Terry, Thanks for the fix. Works great.
Also thanks for all the work you put into your
website. I bookmarked it - its very helpful.


0 new messages