Duplicate record question again with code?

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

Randy

Is there any way I can used the below code and then add 1 month to the
date field of the duplicated record?

Private Sub Command29_Click()
On Error GoTo Err_Command29_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste
Append

Exit_Command29_Click:
Exit Sub

Err_Command29_Click:
MsgBox Err.Description
Resume Exit_Command29_Click

End Sub
 
Try using the dateadd function

Private Sub Command29_Click()
On Error GoTo Err_Command29_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste
Append
me.DateFieldName = DateAdd("m",1,me.DateFieldName)

Exit_Command29_Click:
Exit Sub

Err_Command29_Click:
MsgBox Err.Description
Resume Exit_Command29_Click

End Sub
 
Ofer

Thanks so much. That same question had been asked a number of times in
different groups but I never saw a satisfactory answer. It worked
great.
Just for information I am using it to set up and Alert System for Child
Protective Service workers. It will help them a great deal to keep up
with tasks. It is different from a regular task manager or calendar as
the alerts pop up every day until they complete the task to keep
reminding them to get it done.

Thanks alot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top