Update query on all records in a table automatically

  • Thread starter Thread starter postman
  • Start date Start date
P

postman

Is it possible to run an Update query on all records in a table
automatically.

I have a database with about 120,000 entries with 4 sets of prices. I wish
to run a price matrix (update query) against the price fields in the
database.
The price matrix has 4 columns:
1. autonumber field.
2. query criteria:Between xxx And xxx to filter the records in the first
column of the price fields in database.
3. 3 columns by 50 rows (records) of prices to be applied in the update.

Otherwise will have to make a form with a combobox and manually apply or a
continuous form and scroll through manually 50 times.

Is there a way to automate this process with a stepped
routine (SQL?) that will "blip" it in one go.
Thanks.
 
Yes

what you do is in a code module

Dim SQL1 as string
Dim SQL2 as string
Dim SQL3 as string

build the 3 SQL Queries (Select statements)

then

currentproject.connection.execute SQL1

currentproject.connection.execute SQL2

currentproject.connection.execute SQL3

if you find yourself cycling through a top level table and running queries
within that loop e.g. each time round the loop, in most instances this
cycling can be eliminated using joins in queries or nested select
statements.
 

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

Back
Top