I have a function that opens up a table named JobTable - here is the code for opening the table:
Set rsa = dbs.OpenRecordset("Job_Table", dbOpenDynaset)
That function calls a procedure (while rsa is still open):
Public Function dhAddWorkDaysWoodPrep(lngDays As Long, _
Optional dtmDate As Date = 0, _
Optional adtmDates As Variant) As Date
Dim rs As DAO.Recordset
Dim lngCount As Long
Dim dtmTemp As Date
Set dbs = CurrentDb()
Set rs = dbs.OpenRecordset("Job_Table")
If dtmDate = 0 Then
dtmDate = Date
End If
dtmTemp = dtmDate
For lngCount = 1 To lngDays
dtmTemp = dhNextWorkdayA(dtmTemp, adtmDates)
Next lngCount
With rs
.Edit
rs![WoodPrepCompletionTarget] = dtmTemp
End With
rs.Update
rs.Close
Set rs = Nothing
End Function
--------
The problem I am having is that the Job_Table that is not receiving the updated value for the field WoodPrepCompletionTarget, even though the line rs![WoodPrepCompletionTarget] = dtmTemp has the correct value (I have verified that while I am debugging.)
Is this because the table is already opened by the Function or what am I missing?
Thanks,
Nateofmt
Set rsa = dbs.OpenRecordset("Job_Table", dbOpenDynaset)
That function calls a procedure (while rsa is still open):
Public Function dhAddWorkDaysWoodPrep(lngDays As Long, _
Optional dtmDate As Date = 0, _
Optional adtmDates As Variant) As Date
Dim rs As DAO.Recordset
Dim lngCount As Long
Dim dtmTemp As Date
Set dbs = CurrentDb()
Set rs = dbs.OpenRecordset("Job_Table")
If dtmDate = 0 Then
dtmDate = Date
End If
dtmTemp = dtmDate
For lngCount = 1 To lngDays
dtmTemp = dhNextWorkdayA(dtmTemp, adtmDates)
Next lngCount
With rs
.Edit
rs![WoodPrepCompletionTarget] = dtmTemp
End With
rs.Update
rs.Close
Set rs = Nothing
End Function
--------
The problem I am having is that the Job_Table that is not receiving the updated value for the field WoodPrepCompletionTarget, even though the line rs![WoodPrepCompletionTarget] = dtmTemp has the correct value (I have verified that while I am debugging.)
Is this because the table is already opened by the Function or what am I missing?
Thanks,
Nateofmt