BeforeUpdate and "Run-time error '2115'"

merkava

Registered User.
Local time
Today, 16:53
Joined
Oct 16, 2006
Messages
25
Hi all,

I am basically trying to concatinate a currency symbol to the value of a textbox BEFORE it is saved and I am being hit with the "Run-time error '2115'"

Here is the code:

Private Sub amount_BeforeUpdate(Cancel As Integer)

Select Case strCurrency
Case "CAD Dollar": strCurrency = Chr(36) & Amount.Text
Case "US Dollar": strCurrency = Chr(36) & Amount.Text
Case "UK Pound": strCurrency = Chr(163) & Amount.Text
Case "Euro": strCurrency = Chr(128) & Amount.Text
Case "L-Points": strCurrency = Amount.Text & "Points"
End Select

If MsgBox("Are you sure you want add this currency?", vbQuestion + vbYesNo) = vbNo Then
Me.Undo '-- Returns all of the controls to their original value
Cancel = True
Else
Amount.Value = strCurrency
End If

End Sub

Any tips here would be GREATLY appreciated.

Cheers,
Aaron
 
you propably need to change the text box controls input mask to include the currency symbol you want. You cant store non-numeric data in a numeric text box, which is what you are trying to do.

try me.controls("controlname).inputmask = "£00000.00" etc - i'm not sure about the formatting symbols.
 

Users who are viewing this thread

Back
Top Bottom