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

Conditional Format Form within a Form

Hey guys i'm kind of confused. I'm new to access but I've been getting a lot of progress.

I have a form FRMDATABASE that is loaded into FRMSEARCH and frm search has a bunch of txtboxes that searches the the FRMDATABASE but now I need to conditional format the data within the FRMDATABASE and I have to do it based of code sense I can't limit it to 3.

I use this on the report of the searched criteria and it works like a charm:
Expand|Select|Wrap|Line Numbers
  1. If [Description] Like "*" & "Print Not Available" & "*" Then
  2. [Description].BackColor = &H51A8FF
  3. [Description].FontBold = True
  4. [Description].ForeColor = vbBlack
  5. ElseIf [Description] Like "*" & "In Production" & "*" Then
  6. [Description].BackColor = vbYellow
  7. [Description].FontBold = True
  8. [Description].ForeColor = vbBlack
  9. Else
  10. [Description].BackColor = vbWhite
  11. [Description].FontBold = False
  12. [Description].ForeColor = vbBlack
  13. End If
  14.  
  15. If [General Notes] = "*" & "Ready to Ship on Rack" & "*" Then
  16. [General Notes].BackColor = &HA8ACFF
  17. [General Notes].FontBold = True
  18. [General Notes].ForeColor = vbBlack
  19. ElseIf [General Notes] Like "*" & "Need Test Sheet" & "*" Then
  20. [General Notes].BackColor = &HFFFF00
  21. [General Notes].FontBold = True
  22. [General Notes].ForeColor = vbBlack
  23. ElseIf [General Notes] Like "*" & "Error" & "*" Then
  24. [General Notes].BackColor = vbRed
  25. [General Notes].FontBold = True
  26. [General Notes].ForeColor = vbWhite
  27. ElseIf [General Notes] Like "*" & "Order on Hold" & "*" Then
  28. [General Notes].BackColor = vbRed
  29. [General Notes].FontBold = True
  30. [General Notes].ForeColor = vbWhite
  31. Else
  32. [General Notes].BackColor = vbWhite
  33. [General Notes].FontBold = False
  34. [General Notes].ForeColor = vbBlack
  35. End If
  36.  
I tried making this on the frmSearch under Public ConditionalFormat() <- my own public sub and call for it when they click the search button so the results are formatted.

It pups up errors and stuff.

Also FRMDatabase is based of a query qryDatabase which is based of the main table tblDatabase.

Thanks in Advance!
Jan 13 '08 #1
1 1444
Rabbit
12,516 Expert Mod 8TB
Please use code tags.

Where is the Function located? In the form code module?
Where are you calling the function? From the report? Because you can't do that, it is out of the purview of the report.
And most importantly, what are these error messages you get? It helps to know what errors you're getting if we're going to resolve these errors.
Jan 14 '08 #2

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

Similar topics

6
by: Allan Koch | last post by:
Dear NG, I would like to format a record in a subform, dependent on a value in one field. If one field in the record I show in a subform (datasheet view) is true I like to view that particular...
0
by: web1110 | last post by:
Hi again, I am referring an earlier question here trying to enlarge upon the concept I am pursuing.: Each object is a subassembly. They are all significantly different in detail and content...
1
by: Lloyd Sheen | last post by:
I have the following situation: Need a user resizable user control. After much trying with user control I came across the idea of hosting the controls in a form marked as not TopLevel = false. ...
1
by: Geoff Jones | last post by:
Hi Can anybody give me some example code on creating a form within another form which is centered to the first form? Thanks in advance Geoff
1
by: Martin Schneider | last post by:
Hi! I have an unbound text field conditionally formatted: =DomWert("";"ActiveLines") (DomWert is the german translation for domain value) (to check whether the currend record is within...
0
by: Martin Schneider | last post by:
Hi! I'd like to set the 'enabled'-property for a checkbox depending on a conditional format. Unfortunately, the object doesn't feature a format condition. Is there a solution for this? ...
2
by: Lyn | last post by:
Hi, Having fun trying to get Conditional Formatting working on a textbox control in a continuous form subform (Access 2003). The condition I want is when the value of the textbox is Null and/or...
2
by: keri | last post by:
I would like to set up conditional formatting on a form. One of the fields on the form is a date (). If the calldate field is over 365 days ago I would like all the other fields on the form line...
3
by: kate2272 | last post by:
Hi Guys I was wondering if it is possible to turn AllowEdits to false after data has been entered for individual fields within a form/sub-form. I've found that I can do this in the 'AfterUpDate'...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
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...

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.