Run code on records created with append query

home70

Registered User.
Local time
Today, 01:02
Joined
Jul 10, 2006
Messages
72
I need to run an append query when I open my db that will look at a date in
the records and copy the records when date() >= [PeriodEndDate] and some
other criteria.
I have the append query working perfectly. But the records still need to
have some code run on them to set up fields in the new records that should
not be copied from the old records. It is mostly math and date manipulation
using values in some fields to compute with and write the results to other
fields. When I set the records up manually all the code runs behind the form
to set up these other fields.
What I'm trying to do here is automate the creation of some of the records.
How do I get the code to run on the automatically appended records to get
them set up like the ones I set up manually?
Thank you.
 
Just include the calcs in your append query:

Insert into Table2 (Field1, Field2, Field3)
Select Field1 * Field2 as Expr1, Field3 + Field2 as Expr2, Left(Field4,2) As Expr3
From Table1
Where Field6 > #1/1/2007#

Regards,
Pete
 
OK, I can do that. The problem is now that I don't know how to reference the records in that table from behind my main form (I want to run the query when my main form opens) since it is not bound to that table or another table I use to store a list of dates.
 

Users who are viewing this thread

Back
Top Bottom