Solved

Change appearance of entered numbers

Posted on 2014-11-22
5
101 Views
Last Modified: 2014-11-28
On a form I have two fields.  The first field is named txtSIZE_CURRENT.

If the user enters, for example, 0.109 in that field I want the 2nd field named txtPartNsize to read 1090

(always 4 numbers)

The following is close but I can't get rid of the period.  It is currently reading .1090

Me.txtPartNsize = Format([txtSIZE_CURRENT], Left(".", [txtDecimals]) & String([txtDecimals], "0"))
0
Comment
Question by:SteveL13
5 Comments
 

Author Comment

by:SteveL13
ID: 40459512
Oh, and there is a 3rd field... txtDecimals that will always have a default value of 4
0
 
LVL 18

Expert Comment

by:SimonAdept
ID: 40459528
Is there any restriction on what the user may enter in the first text box. Is it bound to a numeric field or is it unbound with an input mask?

e.g. User entry could be
0.1
14012
99
one
twenty three

From your original example, the input number could simply be multiplied by 10,000 to produce the desired result. I think we need a more extensive set of example inputs and corresponding desired results to advise properly on this.
0
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 250 total points
ID: 40459530
try

Me.txtPartNsize =[txtSIZE_CURRENT] * 10000
0
 
LVL 57
ID: 40459546
I think it might be better to step back and spell out what your trying to do (i.e. significant rounding) rather than focusing on this smaller part of the problem.

Jim.
0
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 250 total points
ID: 40460116
You are close.
Perhaps this, as the default 4 may change:

Me.txtPartNsize = Left(Format([txtSIZE_CURRENT] * 10 ^ [txtDecimals], String([txtDecimals], "0")), [txtDecimals])

/gustav
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now