Adding Rows

F

Floyd Forbes

Help Please, I have a form base on a query with this one row of data. How
can
I add five rows with the date increasing by one on each row e.g
8/17/06,8/18/06
8/19/06,8/20/06. Is there a way to use a command button on a form?

Before
ID Name Date Code Time
1 Floyd 8/16/06 VA 8:00

After
1 Floyd 8/16/06 VA 8:00
1 Floyd 8/1706 VA 8:00
1 Floyd 8/18/06 VA 8:00
1 Floyd 8/19/06 VA 8:00
1 Floyd 8/20/06 VA 8:00

How can I go about getting this to work.

Floyd
 
D

Duane Hookom

Create a small table of numbers [tblNums] with a single, numeric field [Num]
and 5 records 1-5.
Create a query based on your form's record source and limit it to your
current record. Add tblNums to your query and create an "AfterDate" field
like:
AfterDate: DateAdd("d",[Num], [YourBeforeDate])
Change this to an append query that appends the appropriate fields to your
table.
Save the append query.
Add a button to your form to run the append query.
 
Top