From: Salad on
bezz wrote:

> Reading the Value or Caption From an OPtion Group Button using Select Case??
>
>
>
> Normally the use of the select case seems to be as below.
>
> Select Case Me.TPSelect
>
> Case 1
> MSgbox "You Selected 1"
> Case 2
> MSgbox "You Selected 1"
> Case 3
> MSgbox "You Selected 1"
> Case 4
> MSgbox "You Selected 1"
> Case 5
> MSgbox "You Selected 1"
> Case 6
> MSgbox "You Selected 1"
> Case 7
> MSgbox "You Selected 1"
> Case 8
> MSgbox "You Selected 1"
>
> End Select
>
> Would it be possible if say the caption was D1,D2,D3,D4 etc. to pick up the caption name and poke it
> directly into a ext box to act as a filter on an underlying query for a combo box, sort of a rough
> filter and a fine filter to produce an end result.
>
> I could do it as above with the method above I know, but it would be just more compact to have a
> solution like:
>
> FirstPasstxtbox = OptionGroupPressed.Casevalue,
>
> Or even FirstPasstxtbox = OptionGroupPressed.Caption
>
> Thanks
>
> J
>

I've never had the need for what you are doing so there may be better way.

Of course you could modify your message box in the SelectCase statement.
to return the caption.

Anyway. I created an option group with 3 options captions; One, Two,
and Three. The values/index of the frame were 1,2,3. So I changed the
Name property for of each option's label to "LabelOpt" and the index
value. For example, the first radio/checkbox Name property would be
LabelOpt1 if it had an index of 1. I used that nameing scheme for the
rest of the option. Now I can do the following
MsgBox Me("LabelOpt" & Me.TPSelect).Caption



From: Salad on
bezz wrote:
> Got the combo box sorted out now using the method below, as suggested.
>
>
> Me("LabelOpt" & Me.TPSelect).Caption
>
> However, the combo box does change in the underlying query, but the previous entry selected remains
> in the title bar,until a new entry is selected.

I don't grok that line. Sorry.

I have requeried the combo box using the after
> update event of the option group, but this does not repopulate the combo box with the new limited
> list based on the option group value. I have also tried requerying on the form with the AfterINsert
> event which was suggested on a forum post, not effective either.
>
> I suppose its a refresh I want for the data in the source query.
>
> J
>

If your combo box columns somehow reflect caption of the option group (I
doubt since "Me." or "Me!" don't work in a query) I suppose what I'd do
is, after the option value is clicked, do a refresh of data via a
requery. This example assumes the option group frame is called Frame0.
Sub Frame0_AfterUpdate()
Me.YourComboBoxName.Requery
End Sub
So in the AfterUpdate event of the frame run the requery. You could
even enter,
Me.YourComboBoxName = Null
or
Me.YourComboBoxName = 0 'if 1st col is number
in case there is a value and you want to reset it, expecially if there
is a filter in the combo's recordsource.