[AccessD] Unbound numeric textbox reverts to scientific notation

Gustav Brock gustav at cactus.dk
Fri Sep 13 11:31:16 CDT 2013


Hi all

It seems that you can handle this in a simple way by setting the format:

Private Sub txtEuro_Enter()
    Me!txtEuro.Format = "0.00"
End Sub

Private Sub txtEuro_Exit(Cancel As Integer)
    Me!txtEuro.Format = "Euro"
End Sub

It doesn't validate for too large input but that can be arranged otherwise
as needed.

/gustav

-----Oprindelig meddelelse-----
Fra: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] På vegne af Gustav Brock
Sendt: 11. september 2013 20:57
Til: accessd at databaseadvisors.com
Emne: Re: [AccessD] Unbound numeric textbox reverts to scientific notation

Hi Charlotte

OK, thanks. Then I guess there is no easy or elegant way to handle this.

/gustav


>>> charlotte.foust at gmail.com 11-09-13 20:07 >>>
Ah, I missed the unbound part.  I've had similar experiences with unbound
textboxes switching to scientific notation, and I believe I've resorted to
using a string on the unbound box.

Charlotte


On Wed, Sep 11, 2013 at 11:02 AM, Gustav Brock <Gustav at cactus.dk> wrote:

> Hi Charlotte
>
> No, if it is bound to a table with a field of data type Currency, it 
> would work.
>
> But this textbox is unbound.
>
> /gustav
>
> >>> charlotte.foust at gmail.com 11-09-13 19:53 >>>
> Gustav,
>
> I suspect it is a precision issue.  Have you tried changing the 
> datatype to a double and using the format property to set the currency
look?
>
> Charlotte
>
>
> On Wed, Sep 11, 2013 at 12:31 AM, Gustav Brock <gustav at cactus.dk> wrote:
>
> > Hi Darryl
> >
> > Yes, that could work.
> > Still, I find it strange that a value formatted as currency should 
> > appear in scientific notation - which is seen nowhere else.
> >
> > /gustav
> >
> > -----Oprindelig meddelelse-----
> > Fra: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com] På vegne af Darryl Collins
> > Sendt: 11. september 2013 09:02
> > Til: Access Developers discussion and problem solving
> > Emne: Re: [AccessD] Unbound numeric textbox reverts to scientific
notation
> >
> > One possible solution would be enter the 'number' as a string/text 
> > in the form and convert it back to a numeric format upon save/write 
> > to the data table.  That would work, but also introduces some risks 
> > you would have to handle.
> >
> > Cheers
> > Darryl
> >
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
> > Sent: Wednesday, 11 September 2013 4:48 PM
> > To: 'Access Developers discussion and problem solving'
> > Subject: Re: [AccessD] Unbound numeric textbox reverts to scientific
notation
> >
> > Hi all
> >
> > So no solution or workaround to this?
> >
> > /gustav
> >
> > -----Oprindelig meddelelse-----
> > Fra: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com] På vegne af Gustav Brock
> > Sendt: 4. september 2013 09:39
> > Til: 'Access Developers discussion and problem solving'
> > Emne: [AccessD] Unbound numeric textbox reverts to scientific notation
> >
> > Hi all
> >
> > I noticed this question on Experts-Exchange but found, that I can't 
> > figure it out:
> >
> > I have an unbound form. One text box is for currency data (euros) 
> > which is great provided the user only uses up to 11 digits.
> > Now, the limit for currency values is 922,337,203,685,477 i.e. 
> > fifteen digits, but as soon as a user enters more than 11 digits and 
> > moves the focus away from the field and then back, the text box 
> > reverts to scientific notation.
> > <snip>
> >
> > I can replicate this but found that it is not related to neither 
> > Euro nor Currency; as soon as you apply some numeric format, you'll 
> > see this behaviour.
> > Is there any way around it?
> >
> > I've only tested with A2010.
> >
> > /gustav




More information about the AccessD mailing list