I want to cleanup a table by searching record by record for the text "HGIO". The text may be inbedded within other text. If it is there, go to the next record, if not, delete the record. I'm new to VBA in the Access environment, so any help is appreciated. Running Access2002.
Thanks
This is what I have that doesn't work.....I'm not using the find function correctly
=============
Function Cleanup()
Dim rst As DAO.Recordset, c As Field
Set rst = CurrentDb.OpenRecordset("CICSPROD", dbOpenTable)
rst.MoveFirst
Do Until rst.EOF
With rst
If !Field1.Find("HGIO") Then .MoveNext
Else:
Recordset.Delete
End If
End With
Loop
Set rst = Nothing
End Function
Thanks
This is what I have that doesn't work.....I'm not using the find function correctly
=============
Function Cleanup()
Dim rst As DAO.Recordset, c As Field
Set rst = CurrentDb.OpenRecordset("CICSPROD", dbOpenTable)
rst.MoveFirst
Do Until rst.EOF
With rst
If !Field1.Find("HGIO") Then .MoveNext
Else:
Recordset.Delete
End If
End With
Loop
Set rst = Nothing
End Function
Last edited: