Using Visible property in forms

G

Guest

I have written the following code to hide other check boxes depending on
which other one is checked. It also makes a combo box appear which is tied
to a query to supply the list to choose from. The problen is that is only
works for one record. When I switch to the next record the other check boxes
do not come back. Am I missing something here?
Sub Option77_AfterUpdate ()
Me![Options79].Visible = Not Me ! [Option79].Visible
Me![Options81].Visible = Not Me ! [Option81].Visible
Me![Options83].Visible = Not Me ! [Option83].Visible
Me![Combo215].Visible = Not Me ! [Combo215].Visible
Me![Combo217].Visible = Not Me ! [Combo217].Visible
Me![Combo219].Visible = Not Me ! [Combo219].Visible
End Sub

When I go to the next record the other options and combo field stay hidden
instead of starting over. How can I program it to start agian with each new
record?

Thanks for your help!
 
G

Guest

Try and put it on the OnCurrent event of the form, but you need to add a
criteria, when to make it visible

Me![Options79].Visible = Me.Option77
Me![Options81].Visible = Me.Option77
Me![Options83].Visible = Me.Option77
Me![Combo215].Visible = Me.Option77
Me![Combo217].Visible = Me.Option77
Me![Combo219].Visible = Me.Option77

Or, not
 
G

Guest

I tried this but it doesn't work the way I need it to. The idea is to open
the form, choose one of 10 different options. This will make a combo box
appear with specific options in the list that relate to the option box
checked. Once this record is filled out and a new one is started the options
need to be available again to start the process again. Currently what I do
on one record stays for all the other records. Is there a way to make what I
do on one record not reflect on the other records? Thanks.
--
ELL


Ofer said:
Try and put it on the OnCurrent event of the form, but you need to add a
criteria, when to make it visible

Me![Options79].Visible = Me.Option77
Me![Options81].Visible = Me.Option77
Me![Options83].Visible = Me.Option77
Me![Combo215].Visible = Me.Option77
Me![Combo217].Visible = Me.Option77
Me![Combo219].Visible = Me.Option77

Or, not

--
\\// Live Long and Prosper \\//
BS"D


ELL said:
I have written the following code to hide other check boxes depending on
which other one is checked. It also makes a combo box appear which is tied
to a query to supply the list to choose from. The problen is that is only
works for one record. When I switch to the next record the other check boxes
do not come back. Am I missing something here?
Sub Option77_AfterUpdate ()
Me![Options79].Visible = Not Me ! [Option79].Visible
Me![Options81].Visible = Not Me ! [Option81].Visible
Me![Options83].Visible = Not Me ! [Option83].Visible
Me![Combo215].Visible = Not Me ! [Combo215].Visible
Me![Combo217].Visible = Not Me ! [Combo217].Visible
Me![Combo219].Visible = Not Me ! [Combo219].Visible
End Sub

When I go to the next record the other options and combo field stay hidden
instead of starting over. How can I program it to start agian with each new
record?

Thanks for your help!
 

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