I have two combo boxes on my form. The first is the custid field in the customer table. Once the user selects a custid field they are taken to the vehicle combo box. I want to narrow down the data in the vehicle combox box based upon the customer retieved from the custid combo box. Right now it works the first time, but it keeps repeating the vehicle info from the first.
On the custid I have the following:
SELECT Customer.Custid, Customer.[Last Name], Customer.[First Name]
FROM Customer
ORDER BY Customer.[Last Name], Customer.[First Name];
AfterUpdate Event:
Private Sub LastName_AfterUpdate()
FirstName = DLookup("[First Name ]", "Customer", "[CustID ] = " & Me!Custid)
City = DLookup("[City ]", "Customer", "[CustID ] = " & Me!Custid)
State = DLookup("[State ]", "Customer", "[CustID ] = " & Me!Custid)
Zip = DLookup("[Zip Code ]", "Customer", "[CustID ] = " & Me!Custid)
Me!SelectTag = vbNullString
Forms!SelectInvoice!SelectTag.SetFocus
End Sub
The select statement for the SelectTag is:
SELECT Vehicle.Tag, Vehicle.Year, Vehicle.Manufacture, Vehicle.CarType, Vehicle.Custid
FROM Vehicle
WHERE (((Vehicle.Custid)=[Forms]![SelectInvoice]![Custid]))
ORDER BY Vehicle.Year, Vehicle.Manufacture, Vehicle.CarType;
Thanks a ton!