473,394 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Is there a way to set all the text on a forms colour from VBA?

I have a form which captures Environ("USERNAME") as String, what I want to be able to do is then be able to use the username value in an if statement to change the colour of all the text in the form.

So far I have:

Private Sub Form_Load()
Dim strUser As String
strUser = Environ("USERNAME")

If strUser = "A" Then me.??? = 123467

End Sub

I can enter specific object names after the me. to set the colour for that object but this will take a LONG time for all forms fields.
May 28 '10 #1

✓ answered by vb5prgrmr

In VB6.0, not sure about VBA, we are able to use a for each loop construct to loop through me.controls to check typeof control is textbox/label/etc. so we can change the various properties. You might be able to do the same...



Good Luck

1 1061
vb5prgrmr
305 Expert 100+
In VB6.0, not sure about VBA, we are able to use a for each loop construct to loop through me.controls to check typeof control is textbox/label/etc. so we can change the various properties. You might be able to do the same...



Good Luck
May 29 '10 #2

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

Similar topics

7
by: miked | last post by:
Hi, On a webpage I'm authoring I'm having a problem with setting the text background colour. I'm using this: P {color ="FFFFFF"; background-color:"000000"; font-size:10pt; font-family:...
7
by: KiwiBrian | last post by:
Using a div and css how do I have a text background colour that automatically adjusts to the size and amount of the text string? TIA Brian Tozer
2
by: Laphan | last post by:
Hi All Noticed that a lot of sites provide sort of HTML based forms nowadays where you can actually change the text colour and format in the actual text box rather than encapsulate them in tags...
0
by: H-S | last post by:
Can anyone help. I have a C# app developped in C# Express. I have a form which contains several groupboxs, with text labels. I also have a standard "label" on the form. I want to set the label...
20
by: Chor Lit | last post by:
Hi, I asked Bjarne Stroustrup about the idea of adding colour standard for C++, and he said that it is very difficult for compiler vendors to change their IDE. But do you think it is possible ? ...
4
by: dirk | last post by:
Hey, I'm new to php and I'm trying to write some php code so that I can insert data into a mysql database using html forms. I've got two text forms and a submit button. When entering data and...
6
by: oriondcv | last post by:
Hi im using MS Access 2000 for my project im tying to have a form that will ask users to input like a ticket number if not found it will go to another form. But the scenario is that the one...
1
by: elangobala | last post by:
When i keep the mouse over the text box colour changes how to do this anyone help me plz
3
by: amyj | last post by:
I have a page that displays all of the entries from the mqsql database table . the insert page has a field for status . I wanting if the entry is submitted with the field being high for the...
0
by: Gouri.Mahajan7 | last post by:
Hello, I want to change the font of the text in richtextbox without affecting the colour of text. I want some text to be printed in different colours. When I try to change the font of the text...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...

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.