Unanswered: Edit Record in Form with Command Button
While in a form, I neeed to create a copy of the current record and edit that record using a command button. In particular, I need to create a copy of the current record, but have a date field increased by x number of days, where x is a value in a field of the current form - all this should be done on the click of the command button.
On Error GoTo Error_CopyRecord
Dim DayValue As Long
'The variable 'DayValue' must reference the contents of
'the Control on your Form that will hold the Value you
'want to add to the Date. Because of the lack of info
'provided how this will be transforms to an integer value
'is up to you. Perhaps it already is...I don't know.
DayValue = Me.theControlOnForm
'Duplicate the Current Record.
'Increment the Date Field on Form by the number of Days
'specified in the DayValue variable.
Me.myDateFieldOnForm = DateAdd("d", DayValue, CDate(Me.myDateFieldOnForm))
'Get Outta here...
'Process any Errors.
Last edited by CyberLynx; 11-16-07 at 18:22.
Self Taught In ALL Environments.....And It Shows!