Question : Simple code issue with synchronized comboboxes in MS Access

Hello:

I copied this code to synchronize combo boxes and it looks really simple but it doesn't work.  The tables have the necessary relationships built.  Basically the table Segment has both fields segment and business unit.  When I trigger the code it comes up with a box asking to enter the parameter value for the "business unit that I choose in the combobox"

Here is the code:
Private Sub cboBusinessUnit_AfterUpdate()
    Me.cboSegment.RowSource = "SELECT Segment FROM" & _
                               " tblSegment WHERE BusinessUnit = " & Me.cboBusinessUnit & _
                               " ORDER BY Segment"
    Me.cboSegment = Me.cboSegment.ItemData(0)
End Sub

Thank you!

Answer : Simple code issue with synchronized comboboxes in MS Access

try this
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
select customer_name as name, customer_phone as phone
from customer
where p_imported = 1
union ALL
select driver_name, driver_phone
from driver
where p_imported = 1
union ALL
select vendor_name venor_phone
from customer
where p_imported = 1
Random Solutions  
 
programming4us programming4us