views:

36

answers:

1

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

A: 

The resolution to this lies in using the forms Current() method. That causes the form to re-execute the query that is bound in the RowSource property for that list box each time a different record is accessed in the form.

Thank you for your response Mr. Fenton.

Mr. Lost IT Guy
OnCurrent is not a method but an event -- really big different there.
David-W-Fenton