Combo Boxes

round

Registered User.
Local time
Today, 09:49
Joined
Oct 23, 2007
Messages
24
Hello please can some one help me with my issue. I have read the Access FAQ's about cascading combo boxes and I have had no success. Hopefully I have explained well enough.

I have two comdo boxes on my main form.
The first you can search for a persons record via surname and the second you can search via their ID number.

Using either will populate the details section on the form.

combo 1 (surname search) uses:
Code:
SELECT DropDown.surname FROM DropDown ORDER BY DropDown.surname;
as the row source.

It also has the event procedure on after update:
Code:
Private Sub Combo45_AfterUpdate() 
    ' Find the record that matches the control. 
    Dim RS As Object 

    Set RS = Me.Recordset.Clone 
    
    RS.FindFirst "[surnamename] = """ & Me![Combo45] & """" 
    If Not RS.EOF Then Me.Bookmark = RS.Bookmark 
    
    
End Sub

The second combo box is pretty much the same:
Code:
SELECT DropDown.user_id FROM DropDown ORDER BY DropDown.user_id;
as row source.

Code:
Private Sub Combo50_AfterUpdate() 
' Find the record that matches the control. 
    Dim RS As Object 

    Set RS = Me.Recordset.Clone 
    
    RS.FindFirst "[user_id] = """ & Me![Combo50] & """" 
    If Not RS.EOF Then Me.Bookmark = RS.Bookmark 
    

End Sub
as event procedure for after update.

My problem is that if you change one of them it populates the details section but does not change the other combo box to match or correspond with the rest of the form etc.

Is this possible??

Many Thanks
 
Hi Round I am having the same type of issue. How did you resolve this?
Hello please can some one help me with my issue. I have read the Access FAQ's about cascading combo boxes and I have had no success. Hopefully I have explained well enough.

I have two comdo boxes on my main form.
The first you can search for a persons record via surname and the second you can search via their ID number.

Using either will populate the details section on the form.

combo 1 (surname search) uses:
Code:
SELECT DropDown.surname FROM DropDown ORDER BY DropDown.surname;
as the row source.

It also has the event procedure on after update:
Code:
Private Sub Combo45_AfterUpdate() 
    ' Find the record that matches the control. 
    Dim RS As Object 

    Set RS = Me.Recordset.Clone 
    
    RS.FindFirst "[surnamename] = """ & Me![Combo45] & """" 
    If Not RS.EOF Then Me.Bookmark = RS.Bookmark 
    
    
End Sub

The second combo box is pretty much the same:
Code:
SELECT DropDown.user_id FROM DropDown ORDER BY DropDown.user_id;
as row source.

Code:
Private Sub Combo50_AfterUpdate() 
' Find the record that matches the control. 
    Dim RS As Object 

    Set RS = Me.Recordset.Clone 
    
    RS.FindFirst "[user_id] = """ & Me![Combo50] & """" 
    If Not RS.EOF Then Me.Bookmark = RS.Bookmark 
    

End Sub
as event procedure for after update.

My problem is that if you change one of them it populates the details section but does not change the other combo box to match or correspond with the rest of the form etc.

Is this possible??

Many Thanks
 
I have a combo box that I am using to find records and populate the data for that record on the form. Procedure for the combo box is below.

Private Sub Combo12_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[City] = '" & Me![Combo12] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

The combo box is listing the same city multiple times instead of showing it once and populating all records for that city. For example, New York.. I want all customers for NY to show up instead its showing new york 5 times as an option in the combo box. Help!
 
hi karen add "distinct" to your sql statement

I have a combo box that I am using to find records and populate the data for that record on the form. Procedure for the combo box is below.

Private Sub Combo12_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[City] = '" & Me![Combo12] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

The combo box is listing the same city multiple times instead of showing it once and populating all records for that city. For example, New York.. I want all customers for NY to show up instead its showing new york 5 times as an option in the combo box. Help!
 

Users who are viewing this thread

Back
Top Bottom