mvdave wrote:
Quote:
Hello all & I hope I'm posting in the right place..
>
I need to load a temporary table with a range of sequential dates,
passing it a beginning and an end date from a criteria form.
>
I have created the form FrmMakeDayFile with 2 unbound fields
[txtDateFr] and [TxtDateTo]. I simply want to be able to click a
button and have a routine of some sort append records to the table
tblDates with field Ddate inserted starting from txtDateFr and adding
a new record for each date, ending at TxtdateTo. (This data gets used
in a local front-end and is then zapped... but that part's under
control - I just need to quickly seed values to the dayfile table....)
>
I must be having a vague day as something that shoudld so easy is
eluding me... Can anybody start me off please.
>
thankyou.
Dave
Depends on what you already know how to do and what you don't. You need...
A VBA code procedure that opens an editable Recordset against your
destination table.
A Loop within that procedure.
Within the loop you create a date value one larger than the previous loop
iteration DateAdd() function being a good mechanism here.
Within that same loop you insert the generated date into your Recordset.
You start the loop with your start date and you stop the loop after you
have inserted the value matching your end date.
Which of the above do you already know how to do and which do you need help
with?
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com