application-defined or object-defined error

J

jon

Hi
I am getting the above error with the code below.
I don't know what to do but basically the user is asked to confirm and if
they cancel it stops the code so they can correct the error.

Can some explain what I am doing wrong as well a bit of the logic behind the
cancel.

Thanks

Jon




If Me![FreeStatePassFail] = 0 Then

blnok = confirm(" Are You sure the Job has Failed?")
If blnok = -1 Then
DisplayMessage ("oh shit")
Me![CmbFreeStsteStatus] = 4
Me![ChkFreeststateDone] = -1
Set db = CurrentDb()
Set rst = db.OpenRecordset("ComponentNos", dbOpenTable)

With rst
rst.Index = "Componet No"
rst.Seek "=", [CmbJob]
.Edit
.Fields("FreeStateCount") = 0
.Fields("FreeStatePassCount") = 0
.Update

End With
Else

Form.Cancel *** error on this line

End If
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top