Coding for design view or form view

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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.
 
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.
 
Back
Top