+ Reply to Thread
Results 1 to 4 of 4

Decimal problem

  1. #1
    Mats Samson
    Guest

    Decimal problem

    In my registration form I've a textbox for writing the quantity.
    The corresponding controlsource cell in the spreadsheet where my figures are
    collected, is set to "General Number" format. The reason is that the quantity
    sometimes can be without or with 1, 2 or 3 decimals.
    I save my registration lines to a small Excel database and have the
    possibility
    to retrieve my registred line again at a later time.
    If I copy a line containing a value with decimals and in general format,
    to the spreadsheet and then load the form, Excel will hang!
    If it's an integer or I set the cell to number format with fixed decimals,
    it works fine.

    Can this be solved?

  2. #2
    JNW
    Guest

    RE: Decimal problem

    You may try setting the format as 'Text'.

    "Mats Samson" wrote:

    > In my registration form I've a textbox for writing the quantity.
    > The corresponding controlsource cell in the spreadsheet where my figures are
    > collected, is set to "General Number" format. The reason is that the quantity
    > sometimes can be without or with 1, 2 or 3 decimals.
    > I save my registration lines to a small Excel database and have the
    > possibility
    > to retrieve my registred line again at a later time.
    > If I copy a line containing a value with decimals and in general format,
    > to the spreadsheet and then load the form, Excel will hang!
    > If it's an integer or I set the cell to number format with fixed decimals,
    > it works fine.
    >
    > Can this be solved?


  3. #3
    Mats Samson
    Guest

    RE: Decimal problem

    I tried it and it will work, but not properly, I believe!
    I didn't test it fully through but it seems I still will end up in problems.
    If the value is treated as pure text it cannot be used as a part of the
    calculation,
    Quantity x Price = Salesvalue. Furthermore there is the problem with
    localisation,
    as I'm Swedish, my computer is localised to Swedish numerics, using comma as
    decimal delimiter, not period. Excel doesn't work well in a mixed situation
    as Forms textboxes defaults to period delimiter and not knowing when it has
    to convert a number or not, it will be a big mess. I can't use text for
    numerics in my calculation program, that would be asking for more trouble. In
    fact I discovered the problem to be even more complex and posted a new
    message about it tonight. I believe there is a fault in either WindowsXP or
    Office2003/Excel behaviour when localisation is involved
    together with Textboxes.

    "JNW" wrote:

    > You may try setting the format as 'Text'.
    >
    > "Mats Samson" wrote:
    >
    > > In my registration form I've a textbox for writing the quantity.
    > > The corresponding controlsource cell in the spreadsheet where my figures are
    > > collected, is set to "General Number" format. The reason is that the quantity
    > > sometimes can be without or with 1, 2 or 3 decimals.
    > > I save my registration lines to a small Excel database and have the
    > > possibility
    > > to retrieve my registred line again at a later time.
    > > If I copy a line containing a value with decimals and in general format,
    > > to the spreadsheet and then load the form, Excel will hang!
    > > If it's an integer or I set the cell to number format with fixed decimals,
    > > it works fine.
    > >
    > > Can this be solved?


  4. #4
    JNW
    Guest

    RE: Decimal problem

    So maybe format the worksheet to accept 10 decimals (I know that's a lot, but
    hold on). Then in the afterupdate event for the text box put something to
    count the number of non-zeros after the decimal point and adjust the number
    format accordingly. It seems a select case statement would work best. I
    just don't know how to count non-zeros after a decimal point.





    "Mats Samson" wrote:

    > I tried it and it will work, but not properly, I believe!
    > I didn't test it fully through but it seems I still will end up in problems.
    > If the value is treated as pure text it cannot be used as a part of the
    > calculation,
    > Quantity x Price = Salesvalue. Furthermore there is the problem with
    > localisation,
    > as I'm Swedish, my computer is localised to Swedish numerics, using comma as
    > decimal delimiter, not period. Excel doesn't work well in a mixed situation
    > as Forms textboxes defaults to period delimiter and not knowing when it has
    > to convert a number or not, it will be a big mess. I can't use text for
    > numerics in my calculation program, that would be asking for more trouble. In
    > fact I discovered the problem to be even more complex and posted a new
    > message about it tonight. I believe there is a fault in either WindowsXP or
    > Office2003/Excel behaviour when localisation is involved
    > together with Textboxes.
    >
    > "JNW" wrote:
    >
    > > You may try setting the format as 'Text'.
    > >
    > > "Mats Samson" wrote:
    > >
    > > > In my registration form I've a textbox for writing the quantity.
    > > > The corresponding controlsource cell in the spreadsheet where my figures are
    > > > collected, is set to "General Number" format. The reason is that the quantity
    > > > sometimes can be without or with 1, 2 or 3 decimals.
    > > > I save my registration lines to a small Excel database and have the
    > > > possibility
    > > > to retrieve my registred line again at a later time.
    > > > If I copy a line containing a value with decimals and in general format,
    > > > to the spreadsheet and then load the form, Excel will hang!
    > > > If it's an integer or I set the cell to number format with fixed decimals,
    > > > it works fine.
    > > >
    > > > Can this be solved?


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1