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

open form in print preview

Status
Not open for further replies.

hlkelly

Technical User
Jul 11, 2003
108
US
I have a form, which is generated with mail merge fields. I don't want the users to edit the form but I do want them to see it in print preview (if the form isn't in print preview the page header, which contains information they need to see doesn't show).

Can it on open show print preview? I can't find any code to get it to do this.

Heather
 
I get a run time error '2174' "you can't switch to a different view at this time"
 
I had that as the code in another form, calling this new form to open. Are you doing it a different way?
 
Actually...I'd like to put the control on the switchboard so that the form automatically opens that way. So I took the code you gave me and put it in 'on open' for my form (frmPrintOrderLetters)

But the button from the switchboard should go directly to the print preview of that form.

I should have been more clear. Sorry.

Heather
 
If you are opening the form from a command button on the switchboard, then just put that code as the OnClick event of the command button.
 
I used the wizard to create my switchboard (to speed it up more than anything.) I don't see anywhere in the switchboard code where I can put it. It refers to tables, where the switchboard commands are. If I need to do this, do I need to do a custom switchboard (menu)?
 
I figured it out...I created a macro and then set the button on the switchboard to open the form in print preview mode.

I'm new to code...thanks for your help!

 
I only use custom switchboards, so I am not sure if you will need to do that or not. I was just looking at the switchboards, and I couldn't find a way to edit the code. I would suggest that you create a custom switchboard. That way you can completely customize it to do exactly what you want.

If you do that, just put the code from above into the onClick event of a command button.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top