S
sashabaz
Hi all...
I am currently trying to synchronize 2 combo boxes on a form. The 2 boxes
are called Studio and Project. Here is a break down of the design.
Tables:
Studio (storing studio names)
Project (storing project information)
StudioProject (linking studio and project tables so projects can be
assigned/linked to a studio, foreign keys are studio[text], project[text])
Staff (linked to the StudioProject table)
Form:
Staff (allows user to enter staff information i.e. their studio and which
project they are on).
On the form I have 2 combo boxes: cboStudio; cboProject. I want the choice
of studio to limit the choice of project.
- The row source for cboStudio is:
SELECT StudioProject.StudioProjectID, StudioProject.Studio FROM
StudioProject ORDER BY StudioProject.Studio;
- The AfterUpdate() in cboStudio is:
Private Sub cboStudio_AfterUpdate()
Me.Combo2.Requery
Me.Combo2.SetFocus
Me.Combo2.Dropdown
End Sub
- Then in cboProject I have:
SELECT StudioProject.StudioProjectID, StudioProject.Project FROM
StudioProject WHERE StudioProject.Studio = Form![cboStudio] ORDER BY
StudioProject.Project;
I am currently trying to synchronize 2 combo boxes on a form. The 2 boxes
are called Studio and Project. Here is a break down of the design.
Tables:
Studio (storing studio names)
Project (storing project information)
StudioProject (linking studio and project tables so projects can be
assigned/linked to a studio, foreign keys are studio[text], project[text])
Staff (linked to the StudioProject table)
Form:
Staff (allows user to enter staff information i.e. their studio and which
project they are on).
On the form I have 2 combo boxes: cboStudio; cboProject. I want the choice
of studio to limit the choice of project.
- The row source for cboStudio is:
SELECT StudioProject.StudioProjectID, StudioProject.Studio FROM
StudioProject ORDER BY StudioProject.Studio;
- The AfterUpdate() in cboStudio is:
Private Sub cboStudio_AfterUpdate()
Me.Combo2.Requery
Me.Combo2.SetFocus
Me.Combo2.Dropdown
End Sub
- Then in cboProject I have:
SELECT StudioProject.StudioProjectID, StudioProject.Project FROM
StudioProject WHERE StudioProject.Studio = Form![cboStudio] ORDER BY
StudioProject.Project;