Options and associated labels

  • Thread starter Thread starter Zoe
  • Start date Start date
Z

Zoe

I am designing a form that needs to include three options.
One of the options needs to open a label for input. The label should only
be visible if the option is selected.

Is the use of an option group the way to go on this? Is there a better way
to accomplish this?

If so, how do I get the label asociated to the option? I've tried a few
things but cannot seem to get it associated to the option.

Also, I want to base query criteria on the option selected. I'm not certain
how to reference the selected option in my IIf statement.

As always, any assitance is greatly appreciated!
Zoe
 
Zoe,
One of the options needs to open a label for input.
I don't think you mean "a label for input". You probably mean a text
control for input.
Is the use of an option group the way to go on this?
Not enough detail to say. Are those 3 options (assume check boxes)
independent of one another? Can your 3 options all be True or False or a
mix of T/F, or... can just one of 3 options be True or False at a time... as
in an Option Group?
Please provide more details. Describe the options, with control field
name/s, and we can give a more accurate coding.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
You are correct - I do mean a text control for input.

The option buttons are named QS1, QS2a and QS2b. I want the user to only be
able to select one option at a time. (e.g. if QS1 is selected, QS2a and QS2b
cannot be selected).
The option group is named QS.
The text control will be associated with QS2b. I have not created it yet
(don't know how to attached the text control to the option) but will name it
QSsort.
When I used the option group wizard, I selected radio knobs. If check boxes
are better, I can use those instead.
The form that contains the option group is named Menu.

Thanks,
Zoe
 
Zoe,
That's just the info we need...
OK... you have an option group named [QS] with 3 possible options.
That's just fine.
Either check boxes or radio knobs are fine too.

Each of the options in the option group has a numeric value (ex. QS1=1,
QS2a=2, and QS2b=3)
And say that the field you want to hide/show is named [SomeField], and
if QS = 2, then show the [SomeField]
(The SomeField default property Visible would be set to No)

On the AfterUpdate event of QS...

Private Sub QS_AfterUpdate()
If QS = 2 Then
SomeField.Visible = True
Else
SomeField.Visible = False
End If
End Sub

**The exact same code would go into the OnCurrent event for the form, so
that when you browse to any record, SomeField would show/hide according to
the value of QS.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
Works perfectly - Thanks!

Al Campagna said:
Zoe,
That's just the info we need...
OK... you have an option group named [QS] with 3 possible options.
That's just fine.
Either check boxes or radio knobs are fine too.

Each of the options in the option group has a numeric value (ex. QS1=1,
QS2a=2, and QS2b=3)
And say that the field you want to hide/show is named [SomeField], and
if QS = 2, then show the [SomeField]
(The SomeField default property Visible would be set to No)

On the AfterUpdate event of QS...

Private Sub QS_AfterUpdate()
If QS = 2 Then
SomeField.Visible = True
Else
SomeField.Visible = False
End If
End Sub

**The exact same code would go into the OnCurrent event for the form, so
that when you browse to any record, SomeField would show/hide according to
the value of QS.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


Zoe said:
You are correct - I do mean a text control for input.

The option buttons are named QS1, QS2a and QS2b. I want the user to only
be
able to select one option at a time. (e.g. if QS1 is selected, QS2a and
QS2b
cannot be selected).
The option group is named QS.
The text control will be associated with QS2b. I have not created it yet
(don't know how to attached the text control to the option) but will name
it
QSsort.
When I used the option group wizard, I selected radio knobs. If check
boxes
are better, I can use those instead.
The form that contains the option group is named Menu.

Thanks,
Zoe
 
Back
Top