From: bezz on
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


--
--------------------------------- --- -- -
Posted with NewsLeecher v3.9 Final
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -

From: bezz on
Actually found a fairly easy way to do it, was getting hng up on select case...

I set up a Global Variable and then just used the sub below to store the current value in the
variable.

I can now use this to either set a text box for input to a query criteria, to return the required
records, or use the global variable from the query.

I expect there will be a better and more efficient way to do it..


Private Sub DAFrame_AfterUpdate()

GBLDesAreaID = DAFrame.Value


End Sub


--
--------------------------------- --- -- -
Posted with NewsLeecher v3.9 Final
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -

From: bezz on
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 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


--
--------------------------------- --- -- -
Posted with NewsLeecher v3.9 Final
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -