By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,578 Members | 826 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,578 IT Pros & Developers. It's quick & easy.

Format Number with thousands comma but no decimal places

P: n/a
I have a text box that contains the number 1234, I want the value form
the text box to display in a second text box so I used:
[NewTextBox]=[OldTextBox]

The problems is that this displays 1234 and I want it to display 1,234
using a comma for the thousands and no decimal places.

I changed the format on the second text box to:
[NewTextBox]=Format([OldTextBox],”Standard”)

Now is displays 1,234.00. I don’t want the 2 decimal places, I just want
1,234

I then tried:
[NewTextBox]=int(Format([OldTextBox],”Standard”))
which displays 1234 with no comma for the thousands.

Can anyone show me how to force the result of 1,234 with a comma but
without any decimal places please?
Nov 14 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Ntl News Group wrote:
I have a text box that contains the number 1234, I want the value form
the text box to display in a second text box so I used:
[NewTextBox]=[OldTextBox]

The problems is that this displays 1234 and I want it to display 1,234
using a comma for the thousands and no decimal places.

I changed the format on the second text box to:
[NewTextBox]=Format([OldTextBox],”Standard”)

Now is displays 1,234.00. I don’t want the 2 decimal places, I just
want 1,234

I then tried:
[NewTextBox]=int(Format([OldTextBox],”Standard”))
which displays 1234 with no comma for the thousands.

Can anyone show me how to force the result of 1,234 with a comma but
without any decimal places please?
You are not limited to the "named" formats like General, Standard. etc.. You
can also explicitly define the format you want like this...

=Format([OldTextBox], "#,###")

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Nov 14 '06 #2

P: n/a
Rick Brandt wrote:
Ntl News Group wrote:
>I have a text box that contains the number 1234, I want the value form
the text box to display in a second text box so I used:
[NewTextBox]=[OldTextBox]

The problems is that this displays 1234 and I want it to display 1,234
using a comma for the thousands and no decimal places.

I changed the format on the second text box to:
[NewTextBox]=Format([OldTextBox],”Standard”)

Now is displays 1,234.00. I don’t want the 2 decimal places, I just
want 1,234

I then tried:
[NewTextBox]=int(Format([OldTextBox],”Standard”))
which displays 1234 with no comma for the thousands.

Can anyone show me how to force the result of 1,234 with a comma but
without any decimal places please?

You are not limited to the "named" formats like General, Standard. etc.. You
can also explicitly define the format you want like this...

=Format([OldTextBox], "#,###")

Thanks very much, isn’t knowledge a wonderful thing? I tried many different approaches before bothering people on the news group, your answer works perfectly and has saved me a lot of time, thanks again.
Nov 14 '06 #3

P: n/a
Set the newtxtbox equal to the oldtxtbox

In the format tab of the newtxtbox, set the format to standard and the
decimals to 0.

"Ntl News Group" <ia********@ntlworld.comwrote in message
news:Hg******************@newsfe2-gui.ntli.net...
>I have a text box that contains the number 1234, I want the value form the
text box to display in a second text box so I used:
[NewTextBox]=[OldTextBox]

The problems is that this displays 1234 and I want it to display 1,234
using a comma for the thousands and no decimal places.

I changed the format on the second text box to:
[NewTextBox]=Format([OldTextBox],”Standard”)

Now is displays 1,234.00. I don’t want the 2 decimal places, I just want
1,234

I then tried:
[NewTextBox]=int(Format([OldTextBox],”Standard”))
which displays 1234 with no comma for the thousands.

Can anyone show me how to force the result of 1,234 with a comma but
without any decimal places please?

Nov 14 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.