Recurring data

  • Thread starter Thread starter Gail
  • Start date Start date
G

Gail

I have a certain task that is performed once a month for
several locations. The database keeps track of when it
has been completed for each location each month. I
manually enter a new record for each location for the next
month once it has been completed this month. I would like
to have it set up so that once the record has been marked
completed for this month, that the database would
automatically generate a new record for that location for
the next month. A "Job #" is used as the key for the
table. This would be the only data for each record that
would change, all other information remains the same. Is
there a way to set this up? Thank you in advance for any
assistance you can provide.
Gail
 
Gail,

You need to have some code do this thing for you. When you mark your current
record as completed (or when you save this record after changing the
status), there should be a procedure which
1. will copy the current field values into temporary variables
2. will change only those fields specific for each month (the date, for ex.)
and will set the value for "completed" to false
3. will check to see if there's already a record with the new set of values
from previous step
4. if there is no duplicate, then insert the new set of values in the table.

Note. You'll have to consider what will happen if you decide to uncheck a
completed record...

Andrei.
 
4. if there is no duplicate, then insert the new set of values in the table.

What is the best way to insert a record like this? I tried this basic
concept...

1) make a recordset clone to keep track of the old record
2) AddNew into the existing recordset
3) copy values from one to the other
4) Update the new one and toss the old one

Seemed like it should work, but instead Access crashes (not the code, Access
itself) when it gets to the Exit Sub.

Maury
 
Do you have error handling in your sub ? What's the error ?
Did you try stepping through the code (shift+F8) one instruction at a time ?

Maybe you can post the code for the add/update.

Andrei
 

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