Union Select Query (What am i doing wrong)

TheViruz30

Registered User.
Local time
Yesterday, 20:33
Joined
Jan 21, 2006
Messages
33
Please see attached database

If you open the form called people you will see a command button
Called add charge once pressed will open a form called charge

On the Bill To combo Box I have the following Union Select Query

SELECT PrimaryInsurance, PersonID FROM tblpeople UNION Select SecondaryInsurance, PersonID FROM tblPeople

What I want the bill to combo box to display is only the Insurances that are related to the
Patient that the charge is for and not to display other patients insurances


Any Ideas
 

Attachments

looking at your table each person can only have only one Primary and one secondary. On your Charge form I don't see the point in a Combo, in fact I don't even see the point for the charge form because it has nothing more to offer than the People form it just looks redundant.

If you want to describe what your trying to accomplish in more detail maybe we can help more.

But simply you can add a button to your form using the wizard and it will ask you if you want to open the form to a specific record, then you can specify which fields are related. After that I would just change the Bill to combo to a Text box by adding the field from the field list.
 
Union queries often indicate poor design. In your case it does. Instead of two fields for the primary and secondary charge, you should have two records in an associated table.
 

Users who are viewing this thread

Back
Top Bottom