Hello,
I'm trying to update my table with a button on a form after a procedure has run to show the next date due. So it could be Weekly, Monthly, Quarterly etc.
I have used the following which works On Update but not with Run SQL:
If [Frequency] = "Monthly" Then
NextDate = Null
[NextDate] = DateAdd("m", 1, [LastDate])
End If
My code I am trying for weekly is:
Please can someone show me where I am going wrong with this.
Thank you
I'm trying to update my table with a button on a form after a procedure has run to show the next date due. So it could be Weekly, Monthly, Quarterly etc.
I have used the following which works On Update but not with Run SQL:
If [Frequency] = "Monthly" Then
NextDate = Null
[NextDate] = DateAdd("m", 1, [LastDate])
End If
My code I am trying for weekly is:
Code:
DoCmd.RunSQL "UPDATE HealthSafetyKeyDates SET NextDate = Forms.HealthSafety.txtUpdateDate DateAdd('ww', 1, [Forms.HealthSafety.txtUpdateDate]) WHERE Description = Forms.HealthSafety.cbxFireHeading"
Please can someone show me where I am going wrong with this.
Thank you