Error 2585

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When a student has alraedy taken a portion of their test I want to close a
form immediately.

Each portion of the test calls a different form. The questions come up in a
list box. When the student exits the list box, if the student has already
answered the question I want to close the form immediately.

It works but I keep getting a 2585 error number when I do the close event.
Does anyone know a way around this?

Thank You

Granny
 
Trap the error and ignore it if it has no ill effects. How?
Use the forms Error event.
On Error GoTo errh
:ExitRoutine
Exit sub
:errh
If Err.Number = 2585 then
Goto ExitRoutine
Else
Msgbox "Error Number: " & err.number & vbCrFl & " Error Discription: " &
Err.Discription
End If
 
Bill;
Srill not working or I have a coding problem. Here is my code!

Private Sub Form_Error(DataErr As Integer, Response As Integer)

On Error GoTo errClose
: exitroutine
Exit Sub
: errClose
If Err.Number = 2585 Then
GoTo exitroutine
End If

End Sub
Private Sub TextA_LostFocus()

Dim bytError As Byte

If AnsQuestion = "Y" Then
bytError = 255
Else
bytError = 1
End If

If bytError = 255 Then
DoCmd.Close
End If

End Sub

Thanks Granny
 
Back
Top