Updating temporary table

J

Johanna Gronlund

Hello,

I have a following problem:

I have a form with a dropdown menu. The user of the database is able to
choose the company they want to review a report for. I have bound the form
into a table which stores the selected company ID temporarily. A report is
then opened that is supposed to have information of that company only. This
does not happen. I have the following problem:

When users choose a company from the dropdown menu, the temporary table
updates but the new company code is added to the list rather than replacing
the previously chosen code. How can I make it to replace the code?

Many thanks for you help in advance.

Johanna
 
J

Jeff Boyce

How does Access know that you want only one CompanyID in that table? Are
you clearing the table before adding the new one?

Rather than a table to temporarily stored a companyID, what about the idea
of opening the report with a "WHERE" clause that calls for (only) that
companyID?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Johanna Gronlund

Thanks for your reply Jeff.

I have to say that I am not really sure what I am doing so your idea sounds
good. I haven't been able to get clear the temporary table with the previous
ID and that seems to be my problem.

Could you please give me some instruations where to write that clause
(somewhere in form properties or in the actual report itself?) and perhaps
some guidance how to write WHERE clause (or where to look it up)?

Thank you so much for you help,

Johanna
 
J

Jeff Boyce

Johanna

The generic notion is that you'd use a command button to open the report,
and the command button would have code like:

DoCmd.OpenReport,,,..."YourID = " & Me!YourIDField

(actual syntax may vary, so check Access HELP for exact syntax on
"OpenReport").

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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