Automcatically Cross-Referencing Records

T

Tom

I need some help with automatically "cross-referencing" records in a form.

On the form, I have an autonumber field (TrackingNumber). I now added a
combo box (ReferenceNumber) that will hold a cross-reference to another
record.

Here's the process:
- representative "Joe" opens the form and navigates to a specific record
(e.g. autonumber = 175)
- based on Joe's login criteria, the combo box only shows those records that
he created
- in the current record (175), Joe now selects record # 98 in the combobox
- he then moves to another record or closes the form

Here's what I'd like to achieve:
- automatically update the the ReferenceNumber field of record #98 and
cross-reference it with #175.
So, even though Joe made the cross-reference only from one record to another
(175 to 98), the system automatically ensures that the reference is also
made from 98 to 175.


Here's what I envisioned but doesn't seem to work:
- AfterUpdate "ReferenceNumber", execute an update query with the following
SQL code:


UPDATE TableName
SET TableName.ReferenceNumber = [Forms]![NameOfForm].[TrackingNumber]
WHERE (((TableName.TrackingNumber)=[Forms]![NameOfForm].[ReferenceNumber]));


However, after updating the combobox, I now get the following error:

"Run-time error: 3061. Too few parameters. Expected 2."


Any ideas what might be wrong?

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top