synchronising 3 combo boxes?

G

Guest

I have successfully synchronised 2 combo boxes but need to add 1 more. Combo
box 2 (cboFeature) is sychronised to combo box 1 (cboRequirement). I would
like combo box 3 (cboIdentifier) to be synchronised to combo box 2. Is this
possible? the code I have for the first 2 combo boxes is:

Private Sub cboRequirements_AfterUpdate()
On Error Resume Next
cboFeature.RowSource = "Select tblFeature.Feature " & _
"FROM tblFeature " & _
"WHERE tblFeature.Requirements = '" & cboRequirements.Value & "' " & _
"ORDER BY tblFeature.Feature;"
End Sub

Private Sub Combo12_AfterUpdate()

End Sub

Private Sub cboRequirements_Exit(Cancel As Integer)

End Sub

Private Sub Form_Current()
On Error Resume Next
' Synchronise requirements combo with existing feature
cboRequirements = DLookup("[Requirements]", "tblFeature", "[Feature]='"
& cboFeature.Value & "'")
' Synchronise feature combo with existing feature
cboFeature.RowSource = "Select tblFeature.Feature " & _
"FROM tblFeature " & _
"WHERE tblFeature.Requirements = '" & cboRequirements.Value & "' " & _
"ORDER BY tblFeature.Feature;"
End Sub

Can this be modified to synchronise combo box 3 to combo box 2? I'm new to
writing code and would appreciate any help.
 
G

Guest

Where do I add this code - at the end of the code that's already been written?

Van T. Dinh said:
Do similar code for the cboFeature_AfterUpdate.

--
HTH
Van T. Dinh
MVP (Access)


karen said:
I have successfully synchronised 2 combo boxes but need to add 1 more.
Combo
box 2 (cboFeature) is sychronised to combo box 1 (cboRequirement). I
would
like combo box 3 (cboIdentifier) to be synchronised to combo box 2. Is
this
possible? the code I have for the first 2 combo boxes is:

Private Sub cboRequirements_AfterUpdate()
On Error Resume Next
cboFeature.RowSource = "Select tblFeature.Feature " & _
"FROM tblFeature " & _
"WHERE tblFeature.Requirements = '" & cboRequirements.Value & "' "
& _
"ORDER BY tblFeature.Feature;"
End Sub

Private Sub Combo12_AfterUpdate()

End Sub

Private Sub cboRequirements_Exit(Cancel As Integer)

End Sub

Private Sub Form_Current()
On Error Resume Next
' Synchronise requirements combo with existing feature
cboRequirements = DLookup("[Requirements]", "tblFeature", "[Feature]='"
& cboFeature.Value & "'")
' Synchronise feature combo with existing feature
cboFeature.RowSource = "Select tblFeature.Feature " & _
"FROM tblFeature " & _
"WHERE tblFeature.Requirements = '" & cboRequirements.Value & "' "
& _
"ORDER BY tblFeature.Feature;"
End Sub

Can this be modified to synchronise combo box 3 to combo box 2? I'm new
to
writing code and would appreciate any help.
 
G

Guest

I was able to figure out where to put the code. Thanks for the help!

karen said:
Where do I add this code - at the end of the code that's already been written?

Van T. Dinh said:
Do similar code for the cboFeature_AfterUpdate.

--
HTH
Van T. Dinh
MVP (Access)


karen said:
I have successfully synchronised 2 combo boxes but need to add 1 more.
Combo
box 2 (cboFeature) is sychronised to combo box 1 (cboRequirement). I
would
like combo box 3 (cboIdentifier) to be synchronised to combo box 2. Is
this
possible? the code I have for the first 2 combo boxes is:

Private Sub cboRequirements_AfterUpdate()
On Error Resume Next
cboFeature.RowSource = "Select tblFeature.Feature " & _
"FROM tblFeature " & _
"WHERE tblFeature.Requirements = '" & cboRequirements.Value & "' "
& _
"ORDER BY tblFeature.Feature;"
End Sub

Private Sub Combo12_AfterUpdate()

End Sub

Private Sub cboRequirements_Exit(Cancel As Integer)

End Sub

Private Sub Form_Current()
On Error Resume Next
' Synchronise requirements combo with existing feature
cboRequirements = DLookup("[Requirements]", "tblFeature", "[Feature]='"
& cboFeature.Value & "'")
' Synchronise feature combo with existing feature
cboFeature.RowSource = "Select tblFeature.Feature " & _
"FROM tblFeature " & _
"WHERE tblFeature.Requirements = '" & cboRequirements.Value & "' "
& _
"ORDER BY tblFeature.Feature;"
End Sub

Can this be modified to synchronise combo box 3 to combo box 2? I'm new
to
writing code and would appreciate any help.
 

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

Top