Print Preview window focus

L

LenP

I am trying to do a print preview using:

DoCmd.OpenReport strReportName, acViewPreview, , , acWindowNormal

The DoCmd is called in a function "cmdOpenReport (strReportName As String)"
For some reason the focus stays on the SwitchBoard window. How can I get
the focus to the PrintPreview window?

TIA,
Len
 
A

Allen Browne

The new report window should receive focus unless:
a) the report is already open, or
b) the switchboard is open in Dialog mode, or as a popup.

If (a) is the problem, you could solve it with:
Reports(strReportname).SetFocus
 
L

LenP

Allen:
First, let me thank you for your reply and second sorry for the
'newbie-type' questions:

A) the report was not open already, this is the first time opening the
report
B) should I not open the switchboard in Dialog mode?

By way of further explaination, if I open the database holding down the
shift key and run the switchboard, and preview the report, everything works
as it should. It's only when I try to open the dBase as an application (not
holding down the shift key) that I have the problem.

Thanks again,
Len
 
A

Allen Browne

Dialogs and popups will be over the top of other windows.

The fact that it works when you bypass the startup suggests that it is the
startup window mode that is the issue here.
 
L

LenP

You are correct and I managed to solve my problem. Thanks for your help!
One annoying thing I just can't seem to remember, where do you set the
deafult Measurement Unit in Access, i.e. Metric vs Imperial, cms vs inches?

BTW, how are things down under?

Cheers,
Len
 
A

Allen Browne

Access does not have its own setting for the measurement unit as Word does.

It's therefore a matter of setting it in the Windows Control Panel, under
Regional Options.

It's been warm: > 40 degrees C yesterday here in Perth.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top