Ok I have written a calculation form using textboxes as the sngvalue inputs everything works fine so no problems here, but I have tried countless methods to register when the decimal point has been entered or deleted from the textbox, as adding another decimal point raises an error, I am trying to limit the decimal to just 1 ie "." in any textbox which by the way can appear anywhere in the syngvalue.

Anyone out there with a tad of info would be recieved with Joy which, by the way is an emotion of great hapiness..........

9 Years
Discussion Span
Last Post by Mark Red

Or you could try the KeyPress event and count the number of decimal points.


try the lostfocus event then format the value like i.e.

Private Sub Text1_LostFocus()
    Text1.Text = Format(Val(Text1.Text), "######0.00")
End Sub

Thanks for the response seems my code was going all around the garden without going through the gate.

Many thanks to Jirehs pointers.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.