Insert Field Value in MsgBox

  • Thread starter Thread starter Bonnie
  • Start date Start date
B

Bonnie

Hello everyone. Using A02 on XP. Have a form that requires
entry of an amount twice for verification purposes. My
msgbox works fine but this morning a tech called me over.
She was getting the error but was looking at the fields
and they looked the same; 20002.00. However, when I put
the cursor into Me.Amount, I saw 20002.002. Didn't see the
third digit until then. I would like to have my msgbox
state "The 2 amounts do not match. The original amount
keyed in was: 20002.002. Please verify your data and make
appropriate corrections." I have both fields formatted for
2 decimals and thought that would do it.

How can I add a field value to my message box and is there
a way to not allow more than 2 decimals? Both issues can
be used elsewhere so I'd love to find a solution for each.

Thanks in advance for any help and advice. I really,
really love learning stuff here!!!

Private Sub VerifyAmt_AfterUpdate()
Me.Amount.Visible = True
If Me.VerifyAmt <> Me.Amount Then
MsgBox "The 2 amounts do not match. Please verify
your data and make appropriate corrections."
End If
End Sub
 
Try using :

MsgBox "The 2 amounts do not match. The original amount was " +
Str(Me.Amount) + " Please verify
your data and make appropriate corrections."
 
Thanks Jon, exactly what I needed for the insertion. The +
vs & and quote marks confuse me in VB. Any advice for
restricting a number to 2 digits? Where and how is it best
to accomplish that? I'll check back later. Thanks again
for the info, I really appreciate you taking time to help.
 
Back
Top