James on my last question, when all was said and done I ended up using your code but had already gave the points to someone else. I thought I'd ask you just a little more about it and grant you some points. Here is the code you posted.....
This might be a little simpler than using a class and plus it lets you delete a decimal point and then re-enter the decimal point. If you want to reset the textBox you will have to make blDecimal Global to the form and reset it's value to false once the textbox is cleared.
Private Sub Text1_KeyPress(KeyAscii As Integer)
Static blDecimal As Boolean
Dim cValid As String
cValid = "0123456789"
If InStr(cValid, Chr(KeyAscii)) = 0 _
And KeyAscii <> 32 And KeyAscii <> 8 Then
If KeyAscii = 46 And blDecimal = False Then 'Check to see if the flag is set to true
blDecimal = True
KeyAscii = 0
If Len(Text1.Text) > 0 Then _
If KeyAscii = 8 And blDecimal = True And Asc(Mid(Text1.Text, Len(Text1.Text))) = 46 Then blDecimal = False
'The extra check for char (8) is to look for the delete key Because your users may want to delete the decimal point they have inserted you can delete this if you wish.
I've tested this and it works.
Hope this is of some help
The line about the global thing and resetting it to false...could you show me this in code??? I ran into a problem while checking error-control. If the users discovers they typed something in wrong and goes back to the specific textbox to re-type something then the decimal no longer works and it kicks out an error. I figure this is what you were referring to when you said make it global. Example????