Strange effect when closing form

  • Thread starter Thread starter mscertified
  • Start date Start date
M

mscertified

I have a form that the users can set filters to view a subset of records.
They can then page thru the records one at a time.
When they do this and then press my Exit button, the screen flickers almost
like its closing down the form multiple times once for each record that was
viewed. What could cause this?
 
Hi Rupert,

Whenever I get the screen jitter effect, I check out my events. In this
instance, try inserting a break on the Exit button's click event, and step
through the code execution using (F8) - you probably have events defined
that are tripping over each other; instead of an orderly and logical exit,
the events may be bouncing off each other like Pachinko balls.

Hope this helps,
Gordon
 
Private Sub txtExit_Click()
On Error GoTo ER
If Me.Dirty Then
If ValidateForm() Then
DoCmd.Close acForm, "frmHDTicket"
End If
Else
DoCmd.Close acForm, "frmHDTicket"
End If
Exit Sub
ER:
If Err.Number = 2465 Then '???
Resume Next
Else
Call ErrMsg(Err.Number, Err.Description, "txtExit_Click")
End If
End Sub
 
You will have to dig further. The code you posted calls another routine
named ValidateForm(), so you will need to look there also.
 
Back
Top