combo box / linking (1 Viewer)

RpbertS

Registered User.
Local time
Today, 06:19
Joined
Feb 14, 2000
Messages
93
hi,
I have a table that stores a project name and the subprojects of that project, they are both primary keys. in the table they look like this
----------
proj1 sub1
proj1 sub2
etc.
----------
my question is this on a form there are 2 combo boxes next to each other one holds the project and one holds the subproject how would I only show the subprojects that are associated with the project in the first combo box?

thanks for the time,
Rpb
 

Carol

Registered User.
Local time
Today, 06:19
Joined
Jan 15, 2000
Messages
280
Once the project gets selected, then you would have the combo box requeried to reflect only the subprojects connected to the main project. On the On Enter of your subprojects combo box, include this Event Procedure:
Private Sub SubProjects_Enter()
On Error GoTo SubProjects_Enter_Err

DoCmd.Requery "MainProject"


SubProjects_Enter_Exit:
Exit Sub

SubProjects_Enter_Err:
MsgBox Error$
Resume SubProjects_Enter_Exit

End Sub

Change the names used to reflect your combo box names.

Good luck.
 

Users who are viewing this thread

Top Bottom