S
scott
i have a table with dayname, daydate. below is a sub function that i'm
trying to pass a date and have it loop through table, increasing the date by
1 day. i'm getting an error with my counter variable. any ideas?
Sub UpdateWeekDates(sDate As Date)
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
Dim sSQL As String
Dim iCount As Integer
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic
rst.Open ("Select * from t_dow")
iCount = 0
Do Until rst.EOF
rst!dow_Date = sDate ' + iCount
rst.Update
iCount = iCount + 1
Loop
rst.Close
Set rst = Nothing
End Sub
trying to pass a date and have it loop through table, increasing the date by
1 day. i'm getting an error with my counter variable. any ideas?
Sub UpdateWeekDates(sDate As Date)
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
Dim sSQL As String
Dim iCount As Integer
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic
rst.Open ("Select * from t_dow")
iCount = 0
Do Until rst.EOF
rst!dow_Date = sDate ' + iCount
rst.Update
iCount = iCount + 1
Loop
rst.Close
Set rst = Nothing
End Sub