473,503 Members | 12,103 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help with formatting multiple text boxes

1 New Member
Hello:

I have a userform with many text boxes - it is used as a budget guide and lists numbers from a seperate sheet. I know how to format one text box to read #,##0 (TextBox6 = Format(TextBox6, "#,##0"), but there must be a command/code that will format them all this way. I am having to enter code for each one. Does anyone have any suggestions?

Thanks!

Scott Settle
Sep 8 '06 #1
2 1315
blue8
2 New Member
Hi Scott,

As far as I know there is not a cpmmand that will the formatting in 1 go.

This is what I suggest.

Place several objects of differing types on a form including TextBoxes. Utilising a button that you have placed on the form place this code in it's Click event for a demonstration.

'============================
CODE:
Private Sub Command1_Click()
Dim obj As Object
Dim x As Byte

For Each obj In Form1.Controls ' loop through every object on the form
If TypeOf obj Is TextBox Then ' check if the current object is a TextBox
obj.Text = x ' perform any operation on the TextBox
' within this IF statement
x = x + 1
End If
Next
End Sub
'============================


I hope this helps.

Paul
Sep 9 '06 #2
Hemant Pathak
92 Recognized Expert New Member
Hi....................

Blue8 is right u can run this code when user form is activated

private form1_activate()
Dim a as string
Dim Ctl as Control
a="#.##0"

for each ctl in FormName.Controls
if type of ctl is TextBox then
ctl.format=a
end if
next

end sub
Sep 9 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
8908
by: John Kreps | last post by:
(acc 2002) I've got six unbound text boxes on a subform that has a white background. Each of those six boxes has an expression that when true, will change its background from white to another...
2
5560
by: Jayjay | last post by:
I've got a report that has a series of unbound text boxes that are being populated by some variables in code. The format is supposed to be a currancy format, but on a certain series of boxes, I...
6
2321
by: kaosyeti | last post by:
is there a way to create simple help file that i plan on linking to a command button on a form using what's already in access? i will probably be giving out this db that i've written to a number...
2
1954
by: Mitchell Vincent | last post by:
I have a bunch of text boxes and labels that hold currency values. I need some formatting on them, but since they are databound to a set, I'm confused as to how to do that. Do labels and text boxes...
10
47476
by: korund | last post by:
We can use special characters ('\n') to add line breaks in text in JavaScript popup Alert boxes. there is also few additional special characters: \' single quote \" double quote \&...
0
1276
by: mmcd79 | last post by:
I am using .NET 2005 and the integrated Crystal Reporting Engine (v10.2). I don't know what in the world is happening but something isn't right. When I prevew my report in the designer,...
1
1865
by: AmitKu | last post by:
I've got the Gridview going at full speed, and I've enabled editing, but when I click on the "edit" button, this ugly editing UI comes up. Well it's not ugly, but it's not great either. How do I...
4
2907
by: Peter Newman | last post by:
the data input app im writing has some 30 + input fields and i want to be able to format them. I know i can use the .validate on each textbox and format the 'string' however this require loads...
0
5518
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
7212
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5604
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1524
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.