Closing SubForm within a form

  • Thread starter Thread starter Alex Martinez
  • Start date Start date
A

Alex Martinez

Hi,

I am using Access 2002 and I have a form that has a command button when
press a subform will appear as a datasheet view. My question is how do I
close that datasheet view? Any tips or suggestion will be appreciated.
Thank you in advance.
 
Alex said:
I am using Access 2002 and I have a form that has a command button when
press a subform will appear as a datasheet view. My question is how do I
close that datasheet view?


What does "appear" mean. A true subform on a mainform is
not "opened" as a main form is opened.

Maybe you are opening another form using DoCmd.OpenForm? If
so, it's generally up to the user to close it.

If you are making a subform on the main for Visible, then
just make it invisible.
 
Hi Marshall,

My subform is in the Main form it becomes visible when the user press a
command button, but I don't want to create another command button to close
unless I have to. Any suggestions? Thank you in advance.
 
Alex said:
Hi Marshall,

My subform is in the Main form it becomes visible when the user press
a command button, but I don't want to create another command button
to close unless I have to. Any suggestions? Thank you in advance.

Me.SubformControlName.Visible = Not Me.SubformControlName.Visible

This would allow one button to both show and hide the subform.
 
Cool. Thanks for the help.

Rick Brandt said:
Me.SubformControlName.Visible = Not Me.SubformControlName.Visible

This would allow one button to both show and hide the subform.
 
Back
Top