J
jwrnana
Objective: I am attempting to update records weekly (every Wednesday)
through Tuesday (yesterday) with my weekly essett number IF the payment
date falls between my weekly date range. This should calculate the start
date to enter essett date, and modify all appropriate records with correct
information.
An individual, Sam, replied and advised to create a command button on my
form calling it cmdEnterEssett and add the following VBA.
He gave me the following VBA to use, but I when building I am getting the
error message - "expected end of statement" and the last "d" is highlighted.
Private sub cmdEnterEssett_OnClick()
Dim StartDate As Date
StartDate = DateAdd("d",-7,Date())
'this gives last week Wednesday
DoCmd.RunSQL "UPDATE tblSalesData SET [Essett #]=[Enter Essett Number],
[Essett Date] = #"_
& Date() & "# WHERE [Payment Date] Between #" & StartDate & _
"# And DateAdd("d",6,StartDate) & "#;"
End Sub
I would reply to the same post; however, I cannot locate it. It was Tuesday
1-24-06.
Thank you in advance.
JR
through Tuesday (yesterday) with my weekly essett number IF the payment
date falls between my weekly date range. This should calculate the start
date to enter essett date, and modify all appropriate records with correct
information.
An individual, Sam, replied and advised to create a command button on my
form calling it cmdEnterEssett and add the following VBA.
He gave me the following VBA to use, but I when building I am getting the
error message - "expected end of statement" and the last "d" is highlighted.
Private sub cmdEnterEssett_OnClick()
Dim StartDate As Date
StartDate = DateAdd("d",-7,Date())
'this gives last week Wednesday
DoCmd.RunSQL "UPDATE tblSalesData SET [Essett #]=[Enter Essett Number],
[Essett Date] = #"_
& Date() & "# WHERE [Payment Date] Between #" & StartDate & _
"# And DateAdd("d",6,StartDate) & "#;"
End Sub
I would reply to the same post; however, I cannot locate it. It was Tuesday
1-24-06.
Thank you in advance.
JR