views:

19

answers:

0

I have a Access database with 3 tables involved in this problem:

People, addresses, address_person

People has an pID (person ID), Addresses a aID, and address_person has a person field and a address field.

In my form wich displays data about the person I have a listbox with the following source:

SELECT address.ID
FROM address INNER JOIN address_person ON address.ID = address_person.address
WHERE (((address_person.person)=[pID]));

I use this ID to change the source of a subform displaying address data like this:

Private Sub addressListBox_AfterUpdate()
    address_view.Form.RecordSource = "SELECT * FROM [address] where ID=" & addressListBox
End Sub

This works, the only problem being that access gives me a "Specify Relationship" dialog that I can't get rid of. I have tried changing settings, and googling, but nothing comes up. Does anyone know how to get rid of it?