Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loop to add new records?

Status
Not open for further replies.

flemard

Technical User
Nov 12, 2003
3
0
1
IE
I am a novice Access 97 user.

I have a query with the following fields:
EqNo, PMNo, nextduedate, interval

These fields are used to schedule the next preventive maintenance (PM) for equipment.

I am trying to either update this query or else start a new query with the next 12 scheduled dates for each piece of equipment.

I am using a dateadd function (dateadd("ww",1,[nextduedate])) to calculate the future dates but would like a new record for each scheduled date.


advice on adding new records would be appreciated

thanks
 
Hallo,

To make new table records you have to use an append query or code.
An Append query either appends a single record with fixed values, or multiple records based on a SELECT statement.

Have a look in the help and see if that helps. It's probably easier than trying to explain everything here,

- Frink
 
Append is no good by itself as you need something to append. Whatever generates that can itself insert the records.

What you might do is generate the record by selecting 12 (say) existing records eg from the target table itself or from a dummy table. Change the values in the query and append them. I've not thought this through but if you took the latest n records and applied a version of your dateadd function you'd get n records with future dates.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top