A
Anne
I want to reset true values back to false in a query (all
the values in the query are initially "true").
Why isn't this working:
Public Function ResetToZero(strRecSource As String,
strFieldName As String) As String
On Error Resume Next
Dim db As DAO.Database
Dim rst As DAO.Recordset
' Open the recordset and make sure it has records
Set db = DBEngine(0)(0)
Set rst = db.OpenRecordset(strRecSource)
If rst.EOF And rst.BOF = True Then
Exit Function
End If
' loop trough the values on the field and set to
zero
While Not rst.EOF
rst(strFieldName).Value = 0
rst.MoveNext
Wend
Set rst = Nothing
Set db = Nothing
End Function
arrg. Please help. I want to like life again.
the values in the query are initially "true").
Why isn't this working:
Public Function ResetToZero(strRecSource As String,
strFieldName As String) As String
On Error Resume Next
Dim db As DAO.Database
Dim rst As DAO.Recordset
' Open the recordset and make sure it has records
Set db = DBEngine(0)(0)
Set rst = db.OpenRecordset(strRecSource)
If rst.EOF And rst.BOF = True Then
Exit Function
End If
' loop trough the values on the field and set to
zero
While Not rst.EOF
rst(strFieldName).Value = 0
rst.MoveNext
Wend
Set rst = Nothing
Set db = Nothing
End Function
arrg. Please help. I want to like life again.