J
jon
Hi
When users click a control button on my form is a certain tick box is
unchecked it opens a pop up box and asks for confirmation.
If they click cancel I want the code to stop running.
But I am getting the error 'application-defined or object-defined error'
with the code below.
I don't know what I am doing wrong.
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
When users click a control button on my form is a certain tick box is
unchecked it opens a pop up box and asks for confirmation.
If they click cancel I want the code to stop running.
But I am getting the error 'application-defined or object-defined error'
with the code below.
I don't know what I am doing wrong.
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