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

Dynamically loading a list for a combo box

Status
Not open for further replies.

TJones8

Technical User
Apr 16, 2002
77
GB
I've created a form with 2 radio icons, one labled 'pupils', the other 'staff'.
I need to get it so whichever the user clicks on, the combo box loads a list of pupil\staff names from 2 different forms.
Pretty simple i know, but i've been having a hard time getting to work, i cannot even find a methods list for the combo box object in M$'s help.

TIA

T Jones
 
Are your radio buttons part of an option group? I presume they are.

If this is the case, the option group is probably set to return an integer value based upon the button selected. You can then build the combo boxes rowsource based upon this selection:

If Me.opgStaffOrPupils = 1 'Pupils?
Me.cboNames.Rowsource = "SELECT Surname, Forename FORM tblPupils"
Else 'Staff?
Me.cboNames.Rowsource = "SELECT Surname, Forename FROM tblStaff"
End If James Goodman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top