473,412 Members | 2,239 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,412 software developers and data experts.

How do i set a conditional formatt on my subform base on the main form value?

I have a main form that is based on a customer table(Form Name: tblSLA).Each customer has different "CPU SLA %" value.Eg: Customer Name: XYZ and CPU SLA % = 85%.

How do I set a conditional formatting on my subform, if for the month of January,if Customer Name = XYZ and the CPU% is >85% set background as "green" else "red".

You may refer to the attachment for a clearer view.
Attached Images
File Type: jpg Accessquery.jpg (84.6 KB, 240 views)
Mar 28 '11 #1
1 1406
Depending on how you are planning to determine the month i.e is it the current month of the year or a selected month from a list then the answer varies.

However I think if I get what you are asking correctly then the answer should be:

Dim cpumainfrm, cpusubfrm, customername as string
Expand|Select|Wrap|Line Numbers
  1. cpumainfrm = me.cpu_asl_%
  2. cpusubfrm = forms!mainform!subform!cpu%
  3.  
  4. customername = me.customername
  5.  
  6.  
  7. If cpumainfrm > cpusubfrm then forms!mainform!subform!.form.detail = 124512 Else forms!mainform!subform!.form.detail = 454212
You will need to enter your correct form names in place of the mainform! and subform! and select your own colours.

Hope this does the trick for you.
Mar 28 '11 #2

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

Similar topics

4
by: Craig M | last post by:
Hi, I have 2 forms, frmretailorders, and frmretailorderline. in the oncurrent of the main form, I check what the value of !status is. If it is "complete", then i disable all text and combo...
1
by: New2Access | last post by:
Hi, I have a form thats used to enter records into a table. The table and form have fields for Name, week, project, and hours. To assist users, I wish to add a subform that will show them how...
18
by: Darryl Kerkeslager | last post by:
I don't do much with subforms - in fact I've deliberately avoided them - but .... I have a tab control that will contain several subforms, each bound to a separate table, and each table/subform...
1
by: NBruch | last post by:
Ok let me explain what im trying to do: i need a combo box which needs to be linked to a listbox (or combo box doesnt matter which really) then the listbox should bring up the record in a...
0
by: Peter Franklin | last post by:
(Access 2000) On a subform's current event, I have the following coding: Parent!workshopId=Me!workshopId This so I can change the contents of a second subform when the selected row in the first...
1
by: luv4nrt | last post by:
Hello all, I have a membership dB in which I have a form that updates data in 4 tables. One of the tables is bounded to a subform within the Main membership form. I am trying to link all four...
3
by: virtualgreek | last post by:
Dear all, I have a scenario that is driving me nuts. (MS Access 2003) I have a form/subform (Continuous form) where it gets its data from tables Order and Order_Details. In the footer...
1
by: Elainie | last post by:
I have a main form and in it I have a datasheet subform filtered on surname, I would like the users to select a name in their list on the subform then the data moves up into the main form... Is...
4
theaybaras
by: theaybaras | last post by:
Hi everyone, You've all been such a huge help to me since joining, and I'd just like to take a second to let you know how much I appreciate it! That said, I have another supplication! ;) I have...
4
by: Savita23 | last post by:
Hi, I have a subform in datasheet layout embedded in the main form.I want to invoke a procedure on the double click of each record in the subform.Is there a away by which I can fire the double...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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
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
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...

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.