creating query for archiving

G

Guest

Hello,
I am creating an application to archiev sales records.I have to create a
query that checks for changes in certain 'price' fields in the sales table
and if if finds a change, it copies that record with to the archive table.

any ideas how to do this?
the problem is two phased. I need to copy those records from a table whose
'price' fields are changing (to the archive table) and add new records in the
sales table to the archive table directly.

Thanks for you help!!!!!
Joshua

how to create a query that checks for new reocrds in a table and appends
them in a new table?
 
J

Jack MacDonald

You require two queries

the first one finds the records of interest, based on their current
price. Your question was ambigious what constitutes a change --
perhaps you need to join your Archive table to your main table for a
price comparison??? You may need to include Dates as part of your
price selection criteria.

Start by building a Selection query in the grid, and when you find the
correct records according to your price criteria, change it to an
Append query, and nominate the appropriate table and fields. Save this
query.

Then make another query and configure it as an Update query. Select
the same records by price, and make the appropriate changes to their
price. Save this query.

Finally, make a form with a command button. In the Click event of the
command button, use the DoCmd.OpenQuery command to run each of the
queries in sequence.


Hello,
I am creating an application to archiev sales records.I have to create a
query that checks for changes in certain 'price' fields in the sales table
and if if finds a change, it copies that record with to the archive table.

any ideas how to do this?
the problem is two phased. I need to copy those records from a table whose
'price' fields are changing (to the archive table) and add new records in the
sales table to the archive table directly.

Thanks for you help!!!!!
Joshua

how to create a query that checks for new reocrds in a table and appends
them in a new table?


**********************
(e-mail address removed)
remove uppercase letters for true email
http://www.geocities.com/jacksonmacd/ for info on MS Access security
 

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

Similar Threads


Top