select and update query combined

  • Thread starter Thread starter lynn atkinson
  • Start date Start date
L

lynn atkinson

This is a follow up from previous posts for which I need
further clarification.

How can I run a select query to select records and produce
a report, followed by an update query which updates only
the selected records in a one step process for the user?

At the moment I have a select query which does the report
and a completely seperate update query which does the
update bit, but I want to combine the two so one button
will do both with one click.

I have tried copying the sql statement from one of the
queries and pasting it on to the end of the other, but run
in to syntax errors. I am not too familiar with code!

thanks in advance for any help
 
Hi,
You can not do it with one query.

A simple solution is to create a macro that:

(1) setwarnings to off (This is to allow the update query to run without any prompts)
(2) open the report
then
(3) open the update query

Then on your form
Create a button that runs the macro.

This will only need one click to accomplish both tasks.
 
You can not use one query.
A simple solution is to create a macro that:
(1) Setwarning to off (This is to stop any prompts from the update query)
(2) Open the report
(3) open the Update query

On your form create a button to run the macro

This will require only one click to accomplish both tasks.
 
Thanks for your reply. I have put it in to practice and it
works! However, is there a way I can avoid having to input
the query parameters for both queries? The records used in
the select query displayed in the report are the same
records I want updated with the update query.

regards
 
Back
Top