IR_Moon
Registered User.
- Local time
- Tomorrow, 09:12
- Joined
- Jun 6, 2006
- Messages
- 20
Hi folks!
Query:
What I want to know is do objects in an access form have a "type" element that can be accessed through VBA? In essence what I'm trying to do is assign a colour to every label in a form as it opens. In the on open I currently have:
Which works well while all the labels are named lbl, but I'm dealing with an application that someone else has made and I'm tweaking.
Background:
(to save you all asking simple questions):
For one reason or another I've got 9 separate yet essentially identical databases - one for each client. I'm creating a new unified front end which links all the backend tables to the front end for a given client based on a client selection combo box on the opening form. Once this is done I want the database to assign a colour scheme as a visual cue for a user so they don't forget which database they are using. I'm sick of using pastels (which black text looks nice on) and want to use some dark back colours with light or pastel text for the labels. The back color I can do, but basically I wanted to know if I could create a For Each loop to pick out each label by its type (rather than part of its name). As stated, its original design was by someone else and theres literally dozens of forms to wade through and she's not used any sort of naming convention. Call me lazy, but its repeatable code that I'd like to apply to other projects too.
And... One single database for all clients you say? Just you try and convince my bosses. I'm working towards ditching Access in favour of SQL, but they're paranoid about a.) the amount of time (i.e. money) it will take and b.) the possible downtime when I mess it up for the first seven version (they are not very tech savvy)
Query:
What I want to know is do objects in an access form have a "type" element that can be accessed through VBA? In essence what I'm trying to do is assign a colour to every label in a form as it opens. In the on open I currently have:
Code:
For Each label In Me.Form
If Left(label.Name, 3) = "lbl" Then
label.ForeColor = 16777215
End If
Next
Which works well while all the labels are named lbl, but I'm dealing with an application that someone else has made and I'm tweaking.
Background:
(to save you all asking simple questions):
For one reason or another I've got 9 separate yet essentially identical databases - one for each client. I'm creating a new unified front end which links all the backend tables to the front end for a given client based on a client selection combo box on the opening form. Once this is done I want the database to assign a colour scheme as a visual cue for a user so they don't forget which database they are using. I'm sick of using pastels (which black text looks nice on) and want to use some dark back colours with light or pastel text for the labels. The back color I can do, but basically I wanted to know if I could create a For Each loop to pick out each label by its type (rather than part of its name). As stated, its original design was by someone else and theres literally dozens of forms to wade through and she's not used any sort of naming convention. Call me lazy, but its repeatable code that I'd like to apply to other projects too.
And... One single database for all clients you say? Just you try and convince my bosses. I'm working towards ditching Access in favour of SQL, but they're paranoid about a.) the amount of time (i.e. money) it will take and b.) the possible downtime when I mess it up for the first seven version (they are not very tech savvy)