G
Guest
I am using the following code, and am not able to pull
the info out I need to update a field in another table.
Public Function TotalHoursPerDay()
Dim TotalHours As Double
Dim rstTotalHoursPerDay As DAO.Recordset
Set db = CurrentDb
Set rstTotalHoursPerDay = db.OpenRecordset("SELECT
[TotHours] as Tim FROM DateRange where [Active] = -1",
dbOpenDynaset)
rstTotalHoursPerDay.MoveFirst
Do Until rstTotalHoursPerDay.EOF
TotalHours = Tim
rstTotalHoursPerDay.MoveNext
Loop
End Function
This seems so simple, but I'm not able to get any of the
TotHours for any records. What am I missing...I'm sure
it's something very simple. I just want to update a
field in another table, but cannot get any data from this
query. Thanks for any help!
Tim
the info out I need to update a field in another table.
Public Function TotalHoursPerDay()
Dim TotalHours As Double
Dim rstTotalHoursPerDay As DAO.Recordset
Set db = CurrentDb
Set rstTotalHoursPerDay = db.OpenRecordset("SELECT
[TotHours] as Tim FROM DateRange where [Active] = -1",
dbOpenDynaset)
rstTotalHoursPerDay.MoveFirst
Do Until rstTotalHoursPerDay.EOF
TotalHours = Tim
rstTotalHoursPerDay.MoveNext
Loop
End Function
This seems so simple, but I'm not able to get any of the
TotHours for any records. What am I missing...I'm sure
it's something very simple. I just want to update a
field in another table, but cannot get any data from this
query. Thanks for any help!
Tim