Copy and create a new subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subform with several fields, one of which is designed to take a
date. What I'd like to do is create a button that will automatically create
a new record with the same data, except adding one week to the date entered.

So, for example, if I had a record with the information:

6/12/05 Stress Management Mon-Thurs 6:30

Clicking the button would create a new record with the information:

6/19/05 Stress Management Mon-Thurs 6:30

Is this possible to do? TIA
 
Try this
Private Sub CopyRec_Click()
'=========Put the focus on the subform ==========
Me.SubFormName.SetFocus
'========= To Copy =======================
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
'======================================
'======To change the date ===================
me.dateFieldName=dateadd("d",7,me.dateFieldName)

End Sub
 
Back
Top