G
Guest
Good afternoon,
I'm having trouble getting my SQL Update Query to read a variable value into
the field specified (or any field for that matter). This is my first Access
application in over a year (still working on the Vacation Planner, but have
backtracked to the setup phase... where HR runs a form and fills in all the
Mondays of the bid year), so I'm horribly rusty. I need to populate the
"WeekStart" field in the table. Can someone please help?
The SQL statement was created by creating a query in the query builder and
converting it to SQL, then changing as needed. Code is:
Private Sub cmdSubmit_Click()
Dim dsetdate As Date
dsetdate = DateValue(Forms!frmCalSetup.txtdate)
Dim intcurweek As Integer
For intcurweek = 1 To 51
DoCmd.RunSQL "UPDATE [tblVacRestrict-Updated] SET
[tblVacRestrict-Updated].WeekStart = dsetdate WHERE
((([tblVacRestrict-Updated].WeekNo) = intcurweek))"
dsetdate = DateAdd("d", 7, dsetdate)
Next intcurweek
End Sub
Thank you for helping! I appreciate it!
Derek
I'm having trouble getting my SQL Update Query to read a variable value into
the field specified (or any field for that matter). This is my first Access
application in over a year (still working on the Vacation Planner, but have
backtracked to the setup phase... where HR runs a form and fills in all the
Mondays of the bid year), so I'm horribly rusty. I need to populate the
"WeekStart" field in the table. Can someone please help?
The SQL statement was created by creating a query in the query builder and
converting it to SQL, then changing as needed. Code is:
Private Sub cmdSubmit_Click()
Dim dsetdate As Date
dsetdate = DateValue(Forms!frmCalSetup.txtdate)
Dim intcurweek As Integer
For intcurweek = 1 To 51
DoCmd.RunSQL "UPDATE [tblVacRestrict-Updated] SET
[tblVacRestrict-Updated].WeekStart = dsetdate WHERE
((([tblVacRestrict-Updated].WeekNo) = intcurweek))"
dsetdate = DateAdd("d", 7, dsetdate)
Next intcurweek
End Sub
Thank you for helping! I appreciate it!
Derek