Make subform visible when command button is clicked

  • Thread starter Thread starter Tara
  • Start date Start date
T

Tara

I have a subform that I only want to be visible when a
command button is clicked. I'm sure it's simple to do,
but I'm pretty new to VB and I'm not sure of the code.
Any help would be appreciated!
 
on the main form set the visible property for the subform
as NO
then in the event for the command button put the following

me.subformname.visible = true
 
This worked fine...now is there a way to have the subform
close again once I move to the next/new record?
Thanks!
 
in the oncurrent event of the form put:

me.subformname.visible = false

oncurrent means each time the focus moves to a new record.

Rick


This worked fine...now is there a way to have the subform
close again once I move to the next/new record?
Thanks!
 
Worked perfectly!
Thanks!
-----Original Message-----
in the oncurrent event of the form put:

me.subformname.visible = false

oncurrent means each time the focus moves to a new record.

Rick


This worked fine...now is there a way to have the subform
close again once I move to the next/new record?
Thanks!


.
 
Back
Top