Need data repeated in table

  • Thread starter Thread starter A & K Merchandise
  • Start date Start date
A

A & K Merchandise

I am new to coding and therefore don't have much experience.

My problem is this:

I have a date field and other fields within a table.
I want to schedule a certain event but to have it REPEAT either weekly
(every Wednesday) or daily (monday thru friday) until a certain date (Mar
31, 2004 or 1 year or 16 weeks). This would create a record for each event
repeated.

What coding should I use or is there a template or macro that can do this
for me?

Any help on this matter would be appreciated.
You could also email me the info to: (e-mail address removed)

Thank you in advance for the help.
 
Hi,

You can open a recordset from the table you want to add records too
Then, you add as many records to that recordset as you wish (so they'll be
added to the underlaying table)

dim rs as recordset
set rs = currentdb.openrecordset(TableNameYouWantToAddRecordsTo)

' add records in a loop
do while <your stop condition gets true>
rs.AddNew
rs![fieldName1] = <some value>
rs![fieldName2] = <...>
' .... set all your fields here
rs.Update
' come other code to update / change variables involved in the condition
'...
loop

HTH,
Bogdan
________________________
Freelance programmer
 
I am new to coding and therefore don't have much experience.

My problem is this:

I have a date field and other fields within a table.
I want to schedule a certain event but to have it REPEAT either weekly
(every Wednesday) or daily (monday thru friday) until a certain date (Mar
31, 2004 or 1 year or 16 weeks). This would create a record for each event
repeated.

An APPEND query using an auxiliary table (say of all the weekday dates
from now through the next five years, easily created in Excel) can
help here. You'll need to decide how to solicit the criteria - it
sounds like you want a lot of flexibility; what do you want the user
to be able to enter? And what information would be stored in this
table? Is it really important to have a couple of hundred records in
your table, identical but for a date?
 
Back
Top