Add new records?

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

I want to use a button to duplicate a selected record with the date
field changed to a new date one month in the future. Is there a way to
do that? Can it also duplicate 6 records with the dates of 1 month, 2
months, 3 months, 4 months, 5 months, and 6 months into the future.
 
Try this --
Create a form to be invisible. Have default for the unbound forms from your
main form.
Clicking your button to open the form using a macro. The macro creates a
new record and then SetValue of each field of the new record from the
invisible form. The SetValue for the date field would be --
DateAdd("m",1,[Forms]![InvisibleForm]![OldDateObject])
 
Randy,

This is not the correct way to do this. Your date field has a one-to-many
relationship with the main table so you need a separate date table. Your
tables should look like:
TblMain
MainID
MyDateID
etc

TblMyDate
MyDateID
MyDate

Link MyDateID in both tables and then use a subform to enter your dates.
 
Back
Top