Coding for design view or form view

M

mndipper

Perhaps this is a simple question, but I'm stumped
How do I ensure that a form will only load/unhide a calling form when it is in the forms view, rather than the design view

That is, when I'm editing a form and close it, its close event opens a higher-level form. I only want this to occur when the form is being used, not edited

TIA for suggestions!
 
R

Rick Brandt

mndipper said:
Perhaps this is a simple question, but I'm stumped.
How do I ensure that a form will only load/unhide a calling form when it
is in the forms view, rather than the design view?
That is, when I'm editing a form and close it, its close event opens a
higher-level form. I only want this to occur when the form is being used,
not edited.

What event are you using? The Close event fires when you go from Normal
view to Design view or if you close from Normal View. It does not fire
when you close from Design view.
 
M

mndipper

Thanks for the info, Rick. You are correct. Apparently, I "miswrote", as this actually happens when I switch from form to design view. This action fires the form's OnClose event:

Private Sub Form_Close()
' open switchboard when this form closes
DoCmd.OpenForm "frmSwitchboard"
End Sub

It isn't closing the form form design view, it is switching into design view. My question, therefore, is: - how do I keep the OnClose event from firing when I switch into design view?


----- Rick Brandt wrote: -----

mndipper said:
Perhaps this is a simple question, but I'm stumped.
How do I ensure that a form will only load/unhide a calling form when it
is in the forms view, rather than the design view?higher-level form. I only want this to occur when the form is being used,
not edited.

What event are you using? The Close event fires when you go from Normal
view to Design view or if you close from Normal View. It does not fire
when you close from Design view.
 

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