Complicated Combo Box Filter

  • Thread starter Thread starter jeremy0028
  • Start date Start date
J

jeremy0028

I have a frm called frmcharges

It has a combo box called PersonID with the following

SELECT tblPeople.PersonID, [tblPeople].[LastName] & ", " &
[tblPeople].[FirstName] & " " & [tblPeople].[MiddleName] AS Expr1
FROM tblPeople;

On the same form I have a combo box called Bill to which looks up
information from a table called tblPeopleInsurance Which as the
following

SELECT tblPeopleInsurance.GuaranterID, tblPeopleInsurance.PersonID,
tblPeopleInsurance.InsuranceName
FROM tblPeopleInsurance;

What I want to do is filter the Bill To combo box based on the personId
combo box on the charge form so thant only the Insurance Name that
belongs to the PersonID will show up in the Bill to combo Box.

So far All People That have Insurances show up in the bill to which i
dont want. I only want the bill to combo box to display Insurance
Names that belong to the PersonID

Any Ideas

Thanks in Advance
 
In the rowsource for the BillTo combobox, add a where clause:
Where tblPeopleInsurance.PersonId = PersonId

In the AfterUpdate event of the PersonId Combobox, you'll need to add a
macro or code to update the records in the second combo. Click the
elipsis(...) to the right of the AfterUpdate event and choose Macro Builder.
In the macro, choose Requery. In the ControlName property below, point to the
BillTo combobox. You can use the expression builder to help with the syntax.
Save the macro.

This should requery the BillTo combo anythime the Person combo is changed.

Barry
 
Back
Top