From: SwMC on
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?
From: Dennis on
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

From: fredg on
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