473,378 Members | 1,427 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,378 software developers and data experts.

Different background colors in a continuous form

5
Hi everybody,

I know this issue has already been posted by others and I viewed all the threads dealing with it, but I still couldn't find the whole answer to my problem.

So here we go:
I have a continuous form named frmEmployees, which has 4 controls: EmployeeNumber, EmployeeName, EmployeeType and Dept. The form is sorted alphabetically and there are 3 employee types. What I need is to have a different background color for each employee type.
If I use the Conditional Formatting, I can have different background color for the EmployeeType control, but I want the other controls in the row also to have the same background color.

Please advise!
Thanks.
Aug 30 '06 #1
2 2503
MMcCarthy
14,534 Expert Mod 8TB
Try this in the Form Load event:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.  
  3.     If Me.EmployeeType = 1 Then
  4.         Me.EmployeeNumber.BackColor = 65280 ' Green
  5.         Me.EmployeeName.BackColor = 65280 ' Green
  6.         Me.EmployeeType.BackColor = 65280 ' Green
  7.         Me.Dept.BackColor = 65280 ' Green
  8.     ElseIf Me.EmployeeType = 2 Then
  9.         Me.EmployeeNumber.BackColor = 16711680 ' Blue
  10.         Me.EmployeeName.BackColor = 16711680 ' Blue 
  11.         Me.EmployeeType.BackColor = 16711680 ' Blue
  12.         Me.Dept.BackColor = 16711680 ' Blue
  13.     Else
  14.         'And so on
  15.     End If
  16.  
  17. End Sub
  18.  
Hi everybody,

I know this issue has already been posted by others and I viewed all the threads dealing with it, but I still couldn't find the whole answer to my problem.

So here we go:
I have a continuous form named frmEmployees, which has 4 controls: EmployeeNumber, EmployeeName, EmployeeType and Dept. The form is sorted alphabetically and there are 3 employee types. What I need is to have a different background color for each employee type.
If I use the Conditional Formatting, I can have different background color for the EmployeeType control, but I want the other controls in the row also to have the same background color.

Please advise!
Thanks.
Aug 31 '06 #2
PeterW
5
Thanks, but it doesn't work. Anyway, meanwhile the user has changed his requirements and the color issue has been dropped.

Thanks again
Aug 31 '06 #3

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

Similar topics

1
by: Spike | last post by:
Hello! Im going to make a javascript for changing alot of images. But im not sure how to do it., where to start.. Ok, first.. this is the isue. I have 3 images(I call them 1a-3a). when u...
3
by: Bob - Andover, MA | last post by:
I know how to define a background color for the entire page, and for a table, and even using style sheets and 'P CLASS=...' for changing paragraph background colors. However, I'd like to be able...
4
by: Franklin | last post by:
WITHOUT KNOWING ANYTHING ABOUT THE CURRENT COLORS, I want to swap the foreground/background colors of a link when someone hovers over it. Is this possible with HTML, CSS, DOM, & JavaScript? If...
2
by: JK | last post by:
Hi All, I am working a form which is tabular layout (continuous form) which will display multiple records at a time. Each line of record needs to be reflected on the color code to show their...
3
by: Marco Simone | last post by:
Hi, I have form with few rows of text boxes and labels. I tried to change colors of labels, when txtBox gets focus, with code. Private Sub txtBox1Row1_GotFocus() Me!lblData1.BackColor =...
4
by: Lachlan Hunt | last post by:
Hi, I'm looking for an interoperable method of determining the current background colour of an element that is set using an external stylesheet. I've tried: elmt.style.backgroundColor; but...
10
by: webgirl | last post by:
Hi there, I've been searching the net & the forums here over the last few days for help with my problem & am getting myself really confused.. hoping someone may be able to help me here. I've...
2
by: aldeb | last post by:
My dilemma is as follows. I have a continous form that I am using as a Visual Display Form to show the status of records (SoeCodes). What their status currently is and what they have been. I have 6...
2
by: Wayne | last post by:
Has anyone found the "Alternate Background Color" property in Access 2007 forms to be buggy? As I scroll a continuous form that is using an alternate background color for every second record, the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...

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.