command button

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

Guest

How do I make a "close form" command button return to the switchboard instead
of just closing the form?

Rookie at coding.

Thank you!
Christine
 
Rabbit said:
How do I make a "close form" command button return to the switchboard
instead
of just closing the form?

Rookie at coding.

Thank you!
Christine

You don't need a "close form" button. Hide your switchboard form when your
target form opens and unhide it when it closes. In the target form's open
event:

Forms("frmSwitchboard").Visible = False

In the form's close event:

Forms("frmSwitchboard").Visible = True

It's a bit clunky in that it will cause an error if the switchboard form
isn't loaded but it should work otherwise.

Keith.
www.keithwilby.com
 
Thank you-- that sounds simple. I have the switchboard set to open
automatically on opening so that should work fine.

Can I ask another question about command buttons? It's a little hard to tell
from the button wizard, and I can't find more detailed descriptions anywhere,
but which command button would refresh the whole form (I have a main form
with several subforms) so that a new entry could be made? I have a 'save the
record' command button already.

Thanks again!
christine
 
Rabbit said:
Thank you-- that sounds simple. I have the switchboard set to open
automatically on opening so that should work fine.

Can I ask another question about command buttons? It's a little hard to
tell
from the button wizard, and I can't find more detailed descriptions
anywhere,
but which command button would refresh the whole form (I have a main form
with several subforms) so that a new entry could be made? I have a 'save
the
record' command button already.

I'm not sure what you mean by "refresh the whole form" - once your record is
saved then what's left to do? There is a "refresh" command in VBA but
you'd be more likely to use it when you've made changes to data from code.

Keith.
 
I guess I mean go to a new record, which would be the 'go to next record',
right? I'm getting it... slowly.

Thank you!
Christine
 
Back
Top