Populate data in cboBox from another cboBox

S

SoggyCashew

Hello, I have a combo box that im using to display departments in the list
using:

SELECT tblDepartment.DptID, tblDepartment.Department FROM tblDepartment;

for its row source. then in the next combo box it populates a lis of names
in that combo box based on what was selected from the department combo box
using:

SELECT qryActiveInactiveEmployees.UserID, [LastName] & ", " & [FirstName] AS
Employees FROM qryActiveInactiveEmployees WHERE
(((qryActiveInactiveEmployees.DptID)=Forms!frmCalendar!cboDepartment));

for its row source. I would like to add a another combo box before
populating the list of employees names. Actually I would like to have this as
my first choice then the department then the list of employees. The new
criteria would be based on what branch is the employee from: Example: Branch
1, Branch 2, Branch 3. My table would consist of:

tblBranch
Field: BrID (pk)
Field: Branch

My question is how would I write its row source so that it works with what I
have?
 
K

Ken Sheridan

For various ways of dong this while maintaining a normalized table design see:


http://community.netscape.com/n/pfx...yMessages&tsn=1&tid=23626&webtag=ws-msdevapps


It uses the local administrative units of county, district and parish in my
area, but the principle is exactly the same.

Ken Sheridan
Stafford, England

SoggyCashew said:
Nevermind I got it!


--
Thanks,
Chad


SoggyCashew said:
Hello, I have a combo box that im using to display departments in the list
using:

SELECT tblDepartment.DptID, tblDepartment.Department FROM tblDepartment;

for its row source. then in the next combo box it populates a lis of names
in that combo box based on what was selected from the department combo box
using:

SELECT qryActiveInactiveEmployees.UserID, [LastName] & ", " & [FirstName] AS
Employees FROM qryActiveInactiveEmployees WHERE
(((qryActiveInactiveEmployees.DptID)=Forms!frmCalendar!cboDepartment));

for its row source. I would like to add a another combo box before
populating the list of employees names. Actually I would like to have this as
my first choice then the department then the list of employees. The new
criteria would be based on what branch is the employee from: Example: Branch
1, Branch 2, Branch 3. My table would consist of:

tblBranch
Field: BrID (pk)
Field: Branch

My question is how would I write its row source so that it works with what I
have?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top