Hiding a combo box with Option Selection

  • Thread starter Newf via AccessMonster.com
  • Start date
N

Newf via AccessMonster.com

I am looking for help with some programming. I have an option box on the form
with 2 selections (Canada (-1)and United States (0)). So when either of then
are selected I need a combo box and lable to hide and another to appear. If
Canada is selected I need the label Province to show (State to hide) combo
box with Provinces to show (combo with States to hide) And vice versa if
United States is selected.

I hope this is enough info..

Newf
 
C

Corey-g via AccessMonster.com

I beleive that you want to use the 'After Update' event for the option group
as the place for the code. And you would need to test for the value of the
selected option, then set the visible properties as required.

HTH,

Corey
 
N

Newf via AccessMonster.com

Corey:
Thanks for the fast response but i should of let you guys know that I'm a
beginner with programing. Anyway to show me or point me to some examples??

Newf

Corey-g said:
I beleive that you want to use the 'After Update' event for the option group
as the place for the code. And you would need to test for the value of the
selected option, then set the visible properties as required.

HTH,

Corey
I am looking for help with some programming. I have an option box on the form
with 2 selections (Canada (-1)and United States (0)). So when either of then
[quoted text clipped - 6 lines]
 
C

Corey-g via AccessMonster.com

Do you understand how to work in the VBE?

What you need to do is select the option group on the form (in design view),
and then in the properties window ( "Alt - Enter" or "right-click -
properties" or an icon on the toolbar). The properties window will have 5
tabs (Format, Data, Event, Other, and All). You need to go to the 'Event'
tab, then chose the 'After Update' event.

When you click in the event, you will see a little box with 3 dots - which
you want to click. This should either prompt you for Macro builder, code
builder, or expression builder (if you haven't already set the option to
alway s use expression builder).

This will take you into a new procedure in the VBE (Visual Basic Environment -
I think) where you will code the VBA to do what you want.

The first this is to test the value of the option group:
If Me.controls("Your OPtion Group Name).value = 0 then
' set the US boxes to display, and Hide the Canadian ones
me.name of the text/label.visible = True or False
Else
' Do the reverse

End if

This isn't going to work by copy and paste, but it should help you to
understand what your looking to do...


Corey



Corey:
Thanks for the fast response but i should of let you guys know that I'm a
beginner with programing. Anyway to show me or point me to some examples??

Newf
I beleive that you want to use the 'After Update' event for the option group
as the place for the code. And you would need to test for the value of the
[quoted text clipped - 9 lines]
 

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