Decimal placement

D

David

On the single form that I have on my db, is it possible to input intergers
and the form place the decimal point 2 places in from the right? Right now
all it does is add 2 zeros which makes me need to manually place the decimal
point in the proper place. This is way too slow.
I have A2007 with Vista x64.
Thanks

David
 
A

Al Campagna

Davis,
Use then AfterUpdate event of your text control...
Example control name = [YourNum], a bound Single or Double type)

Public Sub YourNum_AfterUpdate()
[YourNum] = [YourNum] / 100
End Sub

Enter 12345... get 123.45

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
J

John W. Vinson

On the single form that I have on my db, is it possible to input intergers
and the form place the decimal point 2 places in from the right? Right now
all it does is add 2 zeros which makes me need to manually place the decimal
point in the proper place. This is way too slow.
I have A2007 with Vista x64.
Thanks

David

Integers are by definition whole numbers and do not have any decimal places!
What's the datatype of the field? What's the nature of the data you're
entering?

If you always want two decimals, I'd suggest using a Currency datatype (that's
datatype, not format) rather than any sort of Number, and set the format to
something like "#.00" or "Currency".
 
M

Marshall Barton

David said:
On the single form that I have on my db, is it possible to input intergers
and the form place the decimal point 2 places in from the right? Right now
all it does is add 2 zeros which makes me need to manually place the decimal
point in the proper place. This is way too slow.
I have A2007 with Vista x64.


Try something like this in the text box's AfterUpdate event:

If Not Me.thetextbox.Text Like "*.*" Then
Me.thetextbox = Me.thetextbox / 100
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top