Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking a filter with a radio button selection

Status
Not open for further replies.

dax1

MIS
Nov 18, 2002
8
0
0
CA
Hello,

I am working in a form and I want to link a combo box to the results of a radio button selection. For example if my radio button choices are A, B, and C and I select A, then the list values within the combo box should only display choices related to A (e.g. values related to B & C are filterd out).

If using a combination of a radio button and a combo box is inappropriate could you please suggest an alternate way (ideally without using VBA).

Regards,

Dax
 
I do not know of a way to do this without vba. The vba for this is really easy.
Dim SelectValue as string

Select Case myRadioButton.value
Case 1: SelectValue = "A"
Case 2: SelectValue = "B"
Case 3: SelectValue = "C"
End Select

myComboBox.constrolsource = "SELECT MyLookupField FROM myTable WHERE myField = " & chr(34) & SelectValue & chr(34)

That should give you what you need or pretty close.
 
Try this.
Make up a number of combo boxes and set their property 'Visible' to false. with the radio button, go to properties\ event handler\ on click select the "..." and click on 'Code builder'
Between the two lines provided for you type in thenameofyourcombo.visible = true
Repeat this for each of your combo's
When you want to make the combo box go away again, you simply add the line
thenameofyourcombo.visible = false
to the 'after update' property of your combo box as described above.
good luck!
TomH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top