Trying to set a tempvar in macro on double click event

P

Preston

Hi,
I am having a hard time getting a macro to do what I need it to do. I have
learned how to open a form set to a certain record when double clicking on a
report. I use the double click event to fire a macro that opens the form with
the WHERE section set to ="[customer] = """ & [customer] & """" and it works
without any problems. However, the DB has poor design and I didn't use key
values for the relationships. I am trying to over come this by doing the
following:
set a temp var to the value of the customer that was clicked
use dlookup to lookup the id key of the customer that was clicked
use that id key to filter the openform clause.

this doesn't work for me though. I have tried using settempvar: customer,
[customer] and it doesn't work, tried [Reports]![Invoices By
Customer].[Customer] and it doesn't work either. It sets the tempvar to the
first [customer] on the report and not the one that was clicked. What am i
missing here?
Thank you for any help you can give.
Preston
 

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