I am using a continuous form bound to a table to record unsafe driving
activites to a separate table. I have that module working. However,
as the form is bound, it is more or less a place marker and I need to
delete the data from one field in the table. I have tried to work out the module, but am stumped. Here it is:
I don't get any errors, but it simply doesn't work. Can anyone point me in the right direction to get this working?
activites to a separate table. I have that module working. However,
as the form is bound, it is more or less a place marker and I need to
delete the data from one field in the table. I have tried to work out the module, but am stumped. Here it is:
Code:
Dim dbObject As DAO.Database
Dim strQuery As String
Dim HoldUnsafeTally As Variant
HoldUnsafeTally = Forms!frmDriveAudit!subfrmUnsafe.Form!UnsafeTally.Value
Set dbObject = CurrentDb
If Not IsNull(Forms!frmDriveAudit!subfrmUnsafe.Form!UnsafeTally) Then
strQuery = "UPDATE Unsafe " & _
"SET UnsafeTally = Null " & _
"WHERE UnsafeTally =" & Forms!frmDriveAudit!subfrmUnsafe.Form!UnsafeTally
dbObject.Execute strQuery, dbFailOnError
End If
I don't get any errors, but it simply doesn't work. Can anyone point me in the right direction to get this working?