How do I open my report in print preview mode in Access?

  • Follow


I am using Access 2007.  I have my report opening in print preview mode when 
I open it from the navigation bar.  When I open it from the switchboard it 
opens in report view.  How can I get it to open in print preview from the 
switchboard?
0
Reply Utf 4/7/2010 6:10:01 PM

SwMC,

I am using Access 2007.  I have my report opening in print preview mode when 
 I open it from the navigation bar.  When I open it from the switchboard it 
opens in report view.  How can I get it to open in print preview from the 
switchboard?


I don't know much about switchboard, but here is the VBA code I use to open 
reports in preview mode:

Start Code -----------------------------------

DoCmd.OpenReport strDocName, acViewPreview, , strWhere, acWindowNormal, 
strOpenArgs

End code ----------------------------------------

Where:
- strDocName is the variables that contains your report name
- acViewPreview is an Access Constants that tells Access to open in preview 
mode.  (just type it as it appears)
- strWhere - is a variable that contains a SQL WHERE clause witihout the 
word "WHERE"  - if you do not have a filter, then just leave this parm blank,
- acWindowNormal - tells Access to open a normal window - this is an Access 
constant 
strOpenArgs - if you have opening arguments you want to pass to the report, 
put them in this variable.  If not, leave this parm blank.

I think this answers you question, but I'm not sure.

Dennis
 
0
Reply Utf 4/7/2010 6:57:01 PM


On Wed, 7 Apr 2010 11:10:01 -0700, SwMC wrote:

> I am using Access 2007.  I have my report opening in print preview mode when 
> I open it from the navigation bar.  When I open it from the switchboard it 
> opens in report view.  How can I get it to open in print preview from the 
> switchboard?

Display the VBA code window for the Switchboard form.

Find the Private Function HandleButtonClick(intBtn As Integer)
function in the code.
Drop down a bit further to the  Select Case rst![Command] section of
the function.
Change the conCmdOpenReport so it looks like this:

Case conCmdOpenReport
            DoCmd.OpenReport rst![Argument], acPreview
            
Save the changes. Done.
-- 
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
0
Reply fredg 4/7/2010 10:38:09 PM

2 Replies
1752 Views

(page loaded in 0.065 seconds)

Similiar Articles:
















7/23/2012 3:51:13 PM


Reply: