Drop down list based on previous selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have made sort of a timeregistry with basic and simple tables.

Tabel Job contains (JobID, JobName, Startdate)
Tabel Assignment contains (AssignmentID, AsssignmentName)
Tabel Timeregister contains (key, JobName, AssignmentName, Enddate, Time
used etc...)
And a few other tables.

My question is this in my Form Timeregister, how do I make sure that once
JobName is selected in a dropdownlist, then the dropdownlist for
AssignmentName is automatically reduced to only contain data which is based
on my previous selection?
 
Lets assume the first combo box is called cboJobs and the second
cboAssignments, in the RowSource of the latter include a parameter which
references the former. On the basis of your tables as you've described them
this would be along these lines:

SELECT AssignmentName
FROM TimeRegister
WHERE JobName = Forms!YourForm!cboJobs;

To update cboAssignment's list when a Job is selected you'd requery the
control in the AfterUpdate event procedure of cboJobs with:

Me.cboAssignment.Requery
 
Ken Sheridan said:
Lets assume the first combo box is called cboJobs and the second
cboAssignments, in the RowSource of the latter include a parameter which
references the former. On the basis of your tables as you've described them
this would be along these lines:

SELECT AssignmentName
FROM TimeRegister
WHERE JobName = Forms!YourForm!cboJobs;

To update cboAssignment's list when a Job is selected you'd requery the
control in the AfterUpdate event procedure of cboJobs with:

Me.cboAssignment.Requery
 

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

Back
Top