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

Change Form view 1

Status
Not open for further replies.

tekkyun

Technical User
Oct 23, 2003
122
GB
A really simple one I'm sure......

I have code which opens form in form view, then changes recordsource and displays results.
All I want to do is switch view mode to print preview after changing the recordsource.

If I open form in preview mode (using docmd.openform formname, acpreview), then I can't switch recordsource.

Can I switch view by docmd.domenuitem method?




 
I think I've answered myself.
It is easy.

This seems to work....
DoCmd.RunCommand acCmdPrintPreview

but could I do same with docmd.domenuitem?
 
Hi, tekkyun,

I have a strong bias against domenuitem - I've never had much luck with it, it's too dependent on the version and what menu items are displayed. RunCommand is much more reliable.

Ken S.
 
p.s. I just did a quick check, and the MS website confirms what I thought I remembered... DoMenuItem was officially replaced by the RunCommand method in Access 97 - it is only included in later versions for backward compatibility.

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top