Options Button and focus question

G

Guest

I have 2 option button on my form. Option One is set to display all the data
in the query and Option two let the
user enter a range. I have set the To and From textboxs to Disabled and
Coded the GotFocus on Option two to Enable then textboxs. I would like to
have the textbox set back to disabled when any other option on the form is
selected.
Thanks.
 
F

fredg

I have 2 option button on my form. Option One is set to display all the data
in the query and Option two let the
user enter a range. I have set the To and From textboxs to Disabled and
Coded the GotFocus on Option two to Enable then textboxs. I would like to
have the textbox set back to disabled when any other option on the form is
selected.
Thanks.

The GotFocus is not the best event to use, as the user may select
option1 and the To and From controls are already enabled when you
don't want them enabled unless option2 is selected.

Code the OptionGroup's AfterUpdate event:
[ControlTo].Enabled = [OptionGroupName] = 2
[ControlFrom].Enabled = [OptionGroupName] = 2

Code the Form's Current event:
[ControlTo].Enabled = False
[ControlFrom].Enabled = False
 
G

Guest

Thanks you..

fredg said:
I have 2 option button on my form. Option One is set to display all the data
in the query and Option two let the
user enter a range. I have set the To and From textboxs to Disabled and
Coded the GotFocus on Option two to Enable then textboxs. I would like to
have the textbox set back to disabled when any other option on the form is
selected.
Thanks.

The GotFocus is not the best event to use, as the user may select
option1 and the To and From controls are already enabled when you
don't want them enabled unless option2 is selected.

Code the OptionGroup's AfterUpdate event:
[ControlTo].Enabled = [OptionGroupName] = 2
[ControlFrom].Enabled = [OptionGroupName] = 2

Code the Form's Current event:
[ControlTo].Enabled = False
[ControlFrom].Enabled = False
 

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