PC Review


Reply
Thread Tools Rate Thread

Decimal Places in TextBox

 
 
=?Utf-8?B?QU1ZIFou?=
Guest
Posts: n/a
 
      14th Oct 2006
Hi,
I need to set a certain number of decimal places in a TextBox. Is there a
way to do this with code or in a property?
The TextBox is on a Form. The TextBox is used to display a number Value.
It is not linked to anything outside the form, IE: cells on a worksheet etc.

Thank you,
Amy
 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGF1bCBNYXRoZXdz?=
Guest
Posts: n/a
 
      14th Oct 2006
Amy, you could do something like this:

TextBox.Text = VBA.FormatNumber(Value,2)

where, in this example, 2 represents the number of decimal places that will
be shown in the text box.

"AMY Z." wrote:

> Hi,
> I need to set a certain number of decimal places in a TextBox. Is there a
> way to do this with code or in a property?
> The TextBox is on a Form. The TextBox is used to display a number Value.
> It is not linked to anything outside the form, IE: cells on a worksheet etc.
>
> Thank you,
> Amy

 
Reply With Quote
 
=?Utf-8?B?QU1ZIFou?=
Guest
Posts: n/a
 
      16th Oct 2006
Hi Paul,
Thank you for taking time to answer my question.
It doesn't work. It doesn't show an error, but won't display anything.
Do you know where I should enter the code?
Do I need to declare too? Using Dim?
This is what I have:
Private Sub TextBox3_Change()
TextBox3.Text =VBA.FormatNumber(Value,2)

I'm just learning how to program.
Thanks again if you come back to this post,
Amy

"Paul Mathews" wrote:

> Amy, you could do something like this:
>
> TextBox.Text = VBA.FormatNumber(Value,2)
>
> where, in this example, 2 represents the number of decimal places that will
> be shown in the text box.
>
> "AMY Z." wrote:
>
> > Hi,
> > I need to set a certain number of decimal places in a TextBox. Is there a
> > way to do this with code or in a property?
> > The TextBox is on a Form. The TextBox is used to display a number Value.
> > It is not linked to anything outside the form, IE: cells on a worksheet etc.
> >
> > Thank you,
> > Amy

 
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
Formating # of decimal places displayed in Textbox BRC Microsoft Access Form Coding 1 14th Jul 2007 06:51 AM
How to check decimal places from TextBox input? pedestrian via DotNetMonster.com Microsoft Dot NET Framework Forms 2 24th Aug 2006 12:49 AM
Decimal places in textbox on userform Mark Microsoft Excel Programming 1 22nd Mar 2004 10:56 AM
UserForm TextBox Decimal Places pcsis Microsoft Excel Programming 2 3rd Jan 2004 02:31 PM
decimal places in combined textbox geebee Microsoft Access Form Coding 0 1st Jul 2003 02:26 PM


Features
 

Advertising
 

Newsgroups
 


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