#1   Report Post  
Doug Loewen
 
Posts: n/a
Default Formatting text box

I have 3 text boxes on a form and a label that show the
sum of the 3. How do I format the text boxes and label so
it shows currency. If user enters 123 I want it to
display as $ 123.00 in the text box and in the label.
Thanks for your help
  #2   Report Post  
CyberTaz
 
Posts: n/a
Default

Is this an Excel question or an ACCESS question?

If Access, select the text boxes in the form's Design View and choose
Currency from the Format page of the Properties window.

If not Access, please explain what you mean by "text boxes" & "labels" |:)

"Doug Loewen" wrote:

I have 3 text boxes on a form and a label that show the
sum of the 3. How do I format the text boxes and label so
it shows currency. If user enters 123 I want it to
display as $ 123.00 in the text box and in the label.
Thanks for your help

  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

You can have userforms in excel, too!



CyberTaz wrote:

Is this an Excel question or an ACCESS question?

If Access, select the text boxes in the form's Design View and choose
Currency from the Format page of the Properties window.

If not Access, please explain what you mean by "text boxes" & "labels" |:)

"Doug Loewen" wrote:

I have 3 text boxes on a form and a label that show the
sum of the 3. How do I format the text boxes and label so
it shows currency. If user enters 123 I want it to
display as $ 123.00 in the text box and in the label.
Thanks for your help


--

Dave Peterson
  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

Maybe something like this:

Option Explicit
Dim BlkProc As Boolean
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim myStr As String
With Me.TextBox1
If IsNumeric(.Value) Then
BlkProc = True
myStr = Format(.Value, "$ ##0.00")
.Value = myStr
Me.Label1.Caption = myStr
BlkProc = False
End If
End With
End Sub



Doug Loewen wrote:

I have 3 text boxes on a form and a label that show the
sum of the 3. How do I format the text boxes and label so
it shows currency. If user enters 123 I want it to
display as $ 123.00 in the text box and in the label.
Thanks for your help


--

Dave Peterson
  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default

I set up a boolean variable and never used it!

Option Explicit
Dim BlkProc As Boolean
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim myStr As String
if blkproc = true then exit sub
With Me.TextBox1
If IsNumeric(.Value) Then
BlkProc = True
myStr = Format(.Value, "$ ##0.00")
.Value = myStr
Me.Label1.Caption = myStr
BlkProc = False
End If
End With
End Sub

To stop the code from running itself.


<<snipped


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
how to select multiple text boxes in excel for formatting Rob New Users to Excel 3 April 2nd 23 08:38 PM
How can I force certain text formatting in a cell? eddied Excel Discussion (Misc queries) 2 February 7th 05 12:55 PM
Conditional Formatting of Text... Birmangirl Excel Discussion (Misc queries) 3 January 19th 05 02:45 PM
Formatting text.... Jim Excel Worksheet Functions 2 December 30th 04 08:55 PM
Concatenation formula loses text wrap formatting DFM Excel Discussion (Misc queries) 5 December 27th 04 01:45 PM


All times are GMT +1. The time now is 05:17 AM.

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"