PC Review


Reply
Thread Tools Rate Thread

Decimal Formatting in Windows English vs European Formatting

 
 
Drummer361
Guest
Posts: n/a
 
      7th Aug 2006
Hello,

I am currently working on a project that is used in America, Europe,
and South America, etc.

I have a line of code that works and formats the ComboBox decimals
properly in English, but when I change the Windows Language Options to
German, Spanish, French, etc, (the decimal and periods are reversed) it
gives me a VB Error on the line of code below:

UserForm1.ComboBox1.Value = Format(UserForm1.ComboBox1.Value, "#0.000")

The line of code above is used to format the ComboBox value on page
entry. Does anybody have any idea why this won't work in European
languages?


Also, this line of code happens to work perfectly in all languages
tested so far:

For j = 12 To 23
ComboBox1.AddItem Format((Worksheets("Worksheet1").Cells(j,
11).Value), "#0.000")
Next j

This adds and formats the entries from the Cells to the ComboBox
dropdown menu. It works fine in all languages.

Your help and suggestions are appreciated!

 
Reply With Quote
 
 
 
 
Norman Jones
Guest
Posts: n/a
 
      7th Aug 2006
Hi Drummer,

What error do you receive?

If I used continental European settings, I had no problem with the
indicated line of code.


---
Regards,
Norman



"Drummer361" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I am currently working on a project that is used in America, Europe,
> and South America, etc.
>
> I have a line of code that works and formats the ComboBox decimals
> properly in English, but when I change the Windows Language Options to
> German, Spanish, French, etc, (the decimal and periods are reversed) it
> gives me a VB Error on the line of code below:
>
> UserForm1.ComboBox1.Value = Format(UserForm1.ComboBox1.Value, "#0.000")
>
> The line of code above is used to format the ComboBox value on page
> entry. Does anybody have any idea why this won't work in European
> languages?
>
>
> Also, this line of code happens to work perfectly in all languages
> tested so far:
>
> For j = 12 To 23
> ComboBox1.AddItem Format((Worksheets("Worksheet1").Cells(j,
> 11).Value), "#0.000")
> Next j
>
> This adds and formats the entries from the Cells to the ComboBox
> dropdown menu. It works fine in all languages.
>
> Your help and suggestions are appreciated!
>



 
Reply With Quote
 
Drummer361
Guest
Posts: n/a
 
      7th Aug 2006
Hi Norman,

The error I get is:

Run-time error '380':
Could not set the Value property. Invalid property value.

Then I click "debug" and it sends me to the highlighted line of code
above.


Norman Jones wrote:
> Hi Drummer,
>
> What error do you receive?
>
> If I used continental European settings, I had no problem with the
> indicated line of code.
>
>
> ---
> Regards,
> Norman
>
>
>
> "Drummer361" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello,
> >
> > I am currently working on a project that is used in America, Europe,
> > and South America, etc.
> >
> > I have a line of code that works and formats the ComboBox decimals
> > properly in English, but when I change the Windows Language Options to
> > German, Spanish, French, etc, (the decimal and periods are reversed) it
> > gives me a VB Error on the line of code below:
> >
> > UserForm1.ComboBox1.Value = Format(UserForm1.ComboBox1.Value, "#0.000")
> >
> > The line of code above is used to format the ComboBox value on page
> > entry. Does anybody have any idea why this won't work in European
> > languages?
> >
> >
> > Also, this line of code happens to work perfectly in all languages
> > tested so far:
> >
> > For j = 12 To 23
> > ComboBox1.AddItem Format((Worksheets("Worksheet1").Cells(j,
> > 11).Value), "#0.000")
> > Next j
> >
> > This adds and formats the entries from the Cells to the ComboBox
> > dropdown menu. It works fine in all languages.
> >
> > Your help and suggestions are appreciated!
> >


 
Reply With Quote
 
Drummer361
Guest
Posts: n/a
 
      7th Aug 2006
Ah forget this issue I think I've created a larger monster. I'll post
about it in a new topic.

Drummer361 wrote:
> Hi Norman,
>
> The error I get is:
>
> Run-time error '380':
> Could not set the Value property. Invalid property value.
>
> Then I click "debug" and it sends me to the highlighted line of code
> above.
>
>
> Norman Jones wrote:
> > Hi Drummer,
> >
> > What error do you receive?
> >
> > If I used continental European settings, I had no problem with the
> > indicated line of code.
> >
> >
> > ---
> > Regards,
> > Norman
> >
> >
> >
> > "Drummer361" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hello,
> > >
> > > I am currently working on a project that is used in America, Europe,
> > > and South America, etc.
> > >
> > > I have a line of code that works and formats the ComboBox decimals
> > > properly in English, but when I change the Windows Language Options to
> > > German, Spanish, French, etc, (the decimal and periods are reversed) it
> > > gives me a VB Error on the line of code below:
> > >
> > > UserForm1.ComboBox1.Value = Format(UserForm1.ComboBox1.Value, "#0.000")
> > >
> > > The line of code above is used to format the ComboBox value on page
> > > entry. Does anybody have any idea why this won't work in European
> > > languages?
> > >
> > >
> > > Also, this line of code happens to work perfectly in all languages
> > > tested so far:
> > >
> > > For j = 12 To 23
> > > ComboBox1.AddItem Format((Worksheets("Worksheet1").Cells(j,
> > > 11).Value), "#0.000")
> > > Next j
> > >
> > > This adds and formats the entries from the Cells to the ComboBox
> > > dropdown menu. It works fine in all languages.
> > >
> > > Your help and suggestions are appreciated!
> > >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting a decimal Beeyen Microsoft Access Form Coding 1 10th May 2009 03:39 AM
ComboBox List Formatting Issues in European Regions Drummer361 Microsoft Excel Programming 2 7th Aug 2006 05:58 PM
Formatting for just decimal =?Utf-8?B?ci4gaG93ZWxs?= Microsoft Access Forms 3 1st Dec 2004 02:57 PM
Decimal Formatting Paul Smith Microsoft Excel Misc 1 26th Oct 2004 02:09 PM
Problem With European Formatting of Amounts Tiziano Microsoft Excel Misc 3 20th May 2004 06:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:30 PM.