Trying to fill in records on a form without affecting other record

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!
 
R

Rick B

If only one option can be selected, then why are you not using an option
group with radio buttons? This would allow only one selection. Or, use a
drop-down combo-bow where the user selects the option.

Seems like your structure might be a bit flawed here
 
J

John Spencer

You need code in the form's current event to set the visibility of the
controls. It may be the same code you have in the after Update event of
Option77 or it may be different.

If you want them all to become visible then just do the following for all
the controls

Me![Options79].Visible = True
 
G

Guest

I changed to a combo box. Now how do I set up other combo boxes to appear
depending on what the main combo box has selected? I have 18 other combo
boxes with information to pick from that are related to the options in the
main combo box.
--
ELL


Rick B said:
If only one option can be selected, then why are you not using an option
group with radio buttons? This would allow only one selection. Or, use a
drop-down combo-bow where the user selects the option.

Seems like your structure might be a bit flawed here

--
Rick B



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!
 
G

Guest

I changed to a combo box. Now how do I set up other combo boxes to appear
depending on what the main combo box has selected? I have 18 other combo
boxes with information to pick from that are related to the options in the
main combo box.
--
ELL

--
ELL


John Spencer said:
You need code in the form's current event to set the visibility of the
controls. It may be the same code you have in the after Update event of
Option77 or it may be different.

If you want them all to become visible then just do the following for all
the controls

Me![Options79].Visible = True



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