Hi,
Does anyone knowe of a code that will allow the user to enter a cash value in a textbox without having to use a decimal piont, I want to automatically insert the Decimal point???
Private Sub Text7_Exit(Cancel As Integer)
Select Case Nz(InStr(Text7.Text, "."), 0)
Case 0
Text7.Text = Format(Val(Text7.Text) / 100, "#.00")
Case Else
Text7.Text = Format(Val(Text7.Text), "#.00")
End Select
End Sub
User Enters Value on Exit
nothing .00
0 .00
1 .01
9495 94.95
6.4 6.40
64 .64
623.50 No change
Hope that helps, or at least gets you pointed in the right direction.
Tranman,
I am not quite up to speed on applying the code, but have been wanting to do something about this for a long time (the auto decimal entry thing). I assume this code would be applied to a module? I would want any data entry within the database to be auto decimal per this change. I wonder if you could give me some ideas on how to call this up and apply it within the database? (I guess I'm what you would call a low-power user..) Any info would be appreciated!!
Hmanvel,
Sorry I didn't get back to you on Friday, but I was off work, and boycotting our email system...
We are all noobs at one time or another, and this stuff can look pretty scary. I'll try to keep from getting any more technical than we need to--my favorite quote from Albert Einstein is, "Things should be as simple as possible, but not simpler". Congratulations on finding what is probably the BEST forum for the type of help you're seeking.
Why don't you tell me a bit about your data entry operation and I'll try to lead you down the path of understanding.
Specifically need to know if you're using a form to enter the data, and what is the format of the field in the table (is it numeric or text, is it an integer, or a floating-point number, is there any formatting applied at the table level, are you totaling the field on the form, is it a data entry/continuous form; etc.)
I'm putting out a fire in our Oracle database this morning, so may not get back to you today, but will be glad to stick with you until you have a solution.
Tranman, I thought I would get an email if there was a reply, guess I had it set up wrong! I am entering sales order data, and the numbers in question are dollars, formatted as currency in the table setup, with 2 decimal places (cents). Using a form for date entry. I can follow instructions pretty well, and actually tried to construct a module using your code. But it doesnt work, so I know there is more setup required, i.e. maybe in the form properties etc. Or something in the module setup I am doing wrong, I don't know. Any info greatly appreciated! Regards, Hmanvel nooby-man.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.