How do I select a second field based on a another field

Copper Contributor

I have a table wherein I want to register my worked hours (Urenadministratie1).  I selected a project form the table projects. Every Project has one ore more Projecttaks. Then I want to select a projecttasks from the table projecttasks (Projecttaak).  The next selection does'nt give me result I want.


SELECT Projecttaken.Projecttaak, Projecttaken.Project
FROM Projecttaken
WHERE (((Projecttaken.Project)=[urenaministratie1].[Uproject]));


What do I have to do?

2 Replies


" The next selection does'nt give me result I want."


Please be more specific.

What result is required? 

What is the current (wrong) result?


you need to Put your Table in a Form (name the form Urenadministratie1) and drag 2 combobox.
1 combo for you project (name your combo as Uproject).
2nd combo for the Projecttask (name the combo ProjectTask)
put your Select Query as Rowsource of your 2nd combo.

add code to the 1st combo AfterUpdate event, you Requery ProjectTask combo:

private sub Uproject_AfterUpdate()
end sub