I think you’re confused somewhere. Did you use the TextBox KeyDown Event as
suggested?
Why use the Right(), Left() and Len() Function? These will cause the cursor
to move away as the user continues to key in data, thereby, creating a
problem.
Please refer to my previous post about finding the keycode.
Private Sub YourTextBoxName_KeyDown(KeyCode As Integer, Shift As Integer)
’US keyboard 190 = Dot or 110 = Dot and 188 = comma
MsgBox “KeyCode was “ & KeyCode
If KeyCode = 110 Then KeyCode = 190
MsgBox “KeyCode now is “ & KeyCode
End Sub
“YourTextBoxName†or “YourControlName†refers to the name of the control. You
must rename it. Do not copy the code if you don’t understand it.
If you named your control to say… “txtActualCostâ€, then replace this name to
“Private Sub txtActualCost_KeyDown(KeyCode As Integer, Shift As Integer)â€
“Right(txtActualCost.Text, 1) = Chr(44) Thenâ€
Got it?