Updating temporary table

  • Thread starter Thread starter Johanna Gronlund
  • Start date Start date
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
 
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
 
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
 
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
 
Back
Top