Options Button and focus question

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
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
 
Back
Top