Focus Event

S

Scafidel

I can't seem to get this to work. In the code below, ActualBonus is a
calculation and TotalBonus is entered by the user; both are text fields. I
would like the message to appear after entering the data, but it doesn't seem
to work. I can substitute the value of either [ActualBonus] or (a correct)
[TotalBonus] and it works.
Thanks

Private Sub TotalBonus_LostFocus()
If ActualBonus = TotalBonus Then
MsgBox "Bonus OK"
Else
End If
 
A

Albert D. Kallal

Use the controls after update event.

and, for your code go:

if me.ActualBonus = me.TottalBonus then
msgbox "bonus OK"
end if
 
W

Wayne-I-M

Private Sub TotalBonus_LostFocus()
If Me.TotalBonus = Me.ActualBonus Then
MsgBox "Bonus OK", vbOKOnly, "Bonus ?"
End If
End Sub
 
P

philippe

Scafidel said:
I can't seem to get this to work. In the code below, ActualBonus is a
calculation and TotalBonus is entered by the user; both are text fields.
I
would like the message to appear after entering the data, but it doesn't
seem
to work. I can substitute the value of either [ActualBonus] or (a
correct)
[TotalBonus] and it works.
Thanks

Private Sub TotalBonus_LostFocus()
If ActualBonus = TotalBonus Then
MsgBox "Bonus OK"
Else
End If
 
S

Scafidel

Thanks everyone. I found my error. I had an input mask for TotalBonus that
moved the $ sign, so it appeared as $ 2,600.00 instead of $2,600.00.
--
Scafidel
Lafayette, Louisiana


philippe said:
Scafidel said:
I can't seem to get this to work. In the code below, ActualBonus is a
calculation and TotalBonus is entered by the user; both are text fields.
I
would like the message to appear after entering the data, but it doesn't
seem
to work. I can substitute the value of either [ActualBonus] or (a
correct)
[TotalBonus] and it works.
Thanks

Private Sub TotalBonus_LostFocus()
If ActualBonus = TotalBonus Then
MsgBox "Bonus OK"
Else
End If
 
Top