473,657 Members | 2,523 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 1324
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.Contro ls
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
8938
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 color. These text boxes need to go behind a single line of other bound text boxes (which show the actual record). I.e., the purpose of the unbound text boxes w/conditional formatting is to highlight the record/background with one of six colors.
2
5577
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 need add " ** " or something to denote those particular boxes so they can get the reader to see the footnote for those figures. The report is currently setup to put the text in those boxes in red. This is all well and good on the screen - but...
6
2331
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 of other offices and the instructions i'm going to have to pass along with them are SIMPLE. most people who are the end users of this db are not computer saavy to say the least. what i have now is a command button that says 'press for help' and...
2
1962
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 have some kind of format string that can auto-apply a format to what ever data is entered? Is it possible to create a callback-type function that allows me to specify the formatting (for different currency symbols, etc). Dealing with multiple...
10
47499
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 \& ampersand \\ backslash \n new line
0
1294
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, everything LOOKS just as I designed it. When I actually run the application utilizing a reportviewer control, the report loses and adds it's own formatting. For instance. I have text fields all over the form that are set with their fonts to...
1
1867
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 change the font/font size of the text thats being edited? Thanks in advance, Amit
4
2927
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 of repetitive codeing. Is there a way possible to globally format the textboxes both on the .validate function, as well as when the enter key is pressed. Any suggestions or examples wouldbe very usefull, as i have a loads of these data forms...
0
5558
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 ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
0
8737
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8610
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7345
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6174
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4168
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2735
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 we have to send another system
2
1967
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.