Does after update event triger on enter or exit??

leanpilar

Registered User.
Local time
Today, 09:19
Joined
Aug 13, 2015
Messages
94
I have an unbound form whitch is compiled mynually because the querry result are not updatable...
evrything worked well for month...
now I change a code on a bottons(not the textbox problem) to not open double record but chech first if it exist and opend the record on a new form...
now on a textbox with the problem I have

Code:
Private Sub Text21_Enter()
Me.Text26.BackColor = vbYellow
End Sub
Private Sub Text21_Exit(Cancel As Integer)
Me.Text26.BackColor = vbWhite
End Sub
Private Sub Text22_Enter()
Me.Text27.BackColor = vbYellow
End Sub
Private Sub Text22_Exit(Cancel As Integer)
Me.Text27.BackColor = vbWhite
End Sub
Private Sub Text23_Enter()
Me.Text28.BackColor = vbYellow
End Sub
Private Sub Text23_Exit(Cancel As Integer)
Me.Text28.BackColor = vbWhite
End Sub

the same to text40

and code for after update that add a record on current client...
this code get error if it delete tu null and I manage with the on error event

on text 1,2,3,4 (5 no),6,7 it crash on enter the other work well
if I disable the code on enter and exit with ' it not crash...

any idea??
 
AfterUpdate only fires if the value of a control is changed.
You may be better using got and lost focus if you want to highlight the currently selected control.

And to be honest you would be better still having a read of this http://allenbrowne.com/highlight.html
 
yes the after update was triggered on enter code somehow because if empty my code freeze and I change integer to variant and it works again like it has to...
 

Users who are viewing this thread

Back
Top Bottom