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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio Button Controling Which Lookup?

Status
Not open for further replies.

Maillme

Technical User
Mar 11, 2003
186
NL
Hi There, i have a database which has 2 tables:

tbl_fdri_locations
tbl_sri_locations

these tables are the same, although with different field names. Each table will have different locations.

I have a form which im going to be using for reporting issues:

frm_issue_log

Within this form are 2 radio buttons (not attached to anything):

radio_fdri
radio_sri

the form runs off a table:

tbl_issue_log

Within this table is a field:

location_name (which just now is a simple text field).

So, here's my dilema. I would like it when the user enters data on my form, when they click the "radio_fdri" button, it will populate my "location_name" field with a look up from "tbl_locations_fdri" and if they pick "radio_sri" then it will populate this field with look up options from "tbl_locations_sri" .

im not very up to speed with VBA, so any help with this would be greatly appreciated,

many thanks,

Neil
 
I guess what you mean is that you want a combobox with a row source set to either tbl_fdri_locations or tbl_sri_locations, depending on the radio button? If this is true, you need an Option Group, rather than radio buttons. Then you can say something like:
Code:
Private Sub fraFrame_AfterUpdate()
If Me.fraFrame = 1 Then
    Me.cboCombo.RowSource = "Select Field1,Field2 from tbl_fdri_locations"
Else
    Me.cboCombo.RowSource = "Select Field1,Field2 from tbl_sri_locations"
End If
End Sub


 
Where do i get an "option group"

i think my buttons may be grouped, as they operate correctly. E.g. one or the other only.

thanks alot,

Neil
 
works a treat......

thanks alot,

Neil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top