This question involves 3 tables and 1 form in my Access database.
The tables are: - Contacts - Customers - Contacts to Customers Relationship
The form is: - Manage Contact
What I want. A list box that displays the output of this SQL query:
SELECT Customers.AccountName FROM Customers INNER JOIN [Contacts to Customers Relationship] ON Customers.MasAccountNumber=[Contacts to Customers Relationship].MasAccountNumber WHERE [Contacts to Customers Relationship].ID = 3 ORDER BY Customers.AccountName;
Where you see the "3" in the above SQL statement I would like to have a dynamic value there. Something that references the current records value for the ID column (Contacts table). If I have to do this in a VB script adjusting the list boxes RowSource where would I do that? onLoad for the form doesn't seem to make sense because when someone clicks to change records or add a new record I want it to update for that "Contact" (record).
Any help is appreciated.
TW