By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,337 Members | 2,234 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,337 IT Pros & Developers. It's quick & easy.

Filtered and Multiple Lookups

P: 1
I'm really not very good at access, so this will probably be a sinch for most of you

I have a form with one of the inputs as a lookup. For the sake of an explanation I'll call this lookup the "Department" field

I would then like the next two lookups to look to a table which contains Employee first and last names, for example and the departments which they belong to. I would like the lookup to only show the fields of people who belong to the department which has already been chosen by the first lookup, and then by making only one selection, put two different values (first and last name) in two different columns.

If anyone can help a beginner it would be great!!!
Oct 29 '08 #1
Share this Question
Share on Google+
1 Reply


puppydogbuddy
Expert 100+
P: 1,923
I'm really not very good at access, so this will probably be a sinch for most of you

I have a form with one of the inputs as a lookup. For the sake of an explanation I'll call this lookup the "Department" field

I would then like the next two lookups to look to a table which contains Employee first and last names, for example and the departments which they belong to. I would like the lookup to only show the fields of people who belong to the department which has already been chosen by the first lookup, and then by making only one selection, put two different values (first and last name) in two different columns.

If anyone can help a beginner it would be great!!!
See if this is what you wanted.

Tables>Dept, Employee
Lookups are comboboxes >cboDept, cboEmployee

Assumes that DeptNo and EmployeeNo are both text data types

cboDept>DeptAutonumber(Bound Column(0)-Hidden), DeptNo, DeptName

Expand|Select|Wrap|Line Numbers
  1. cboDept.RowSource = "Select * From Dept"
cboEmployee>EmplAutonumber(Bound Column(0) Hidden), EmployeeID, FirstName, LastName, DeptNo

Expand|Select|Wrap|Line Numbers
  1. cboEmployee.RowSource = "Select * From Employee Where DeptNo = '" & Me!cboDept.Column(1) & "'"

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboEmployee_AfterUpdate()
  2. cboEmployee.RowSource = "Select * From Employee Where  EmployeeID = '" & Me!cboEmployee.Column(1) & "'"
  3. Me!txtFirstName.Value = cboEmployee.Column(2)
  4. Me!txtLastName.Value =  cboEmployee.Column(3)
  5. End Sub
Oct 31 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.