Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default 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   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default 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   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula problem with decimal Gator Excel Worksheet Functions 2 August 29th 08 07:59 PM
Problem with decimal format Richard RE Excel Worksheet Functions 2 June 22nd 06 05:49 PM
problem with decimal in calculation Amanda Excel Discussion (Misc queries) 5 January 12th 06 05:25 PM
Decimal translation problem Francis Hayes (The Excel Addict) Excel Discussion (Misc queries) 1 January 21st 05 02:15 PM
Problem with decimal number smaller than 1 Mlaky Excel Programming 4 February 9th 04 03:29 PM


All times are GMT +1. The time now is 12:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"