Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,929

    don't know about 2007 - suggest google something like 'access 2007 max number of conditional formats' or similar. but suspect you are right

  2. #17
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,422
    Ajax, forgive and correct me if I'm way off base here, but why not just evaluate the conditions in a Select Case block and set one based on the result:

    Code:
    Select Case optGroupChoice
      Case "g"
       With Me![RUNRESERVED]
           .BackColor = lngGreen
           .FontBold = True
           .ForeColor = lngBlack
       End With
      Case "y"
       With Me![RUNRESERVED]
           .BackColor = lngYellow
           .FontBold = True
           .ForeColor = lngBlack
       End With
    etc, etc.
    End Select
    Last edited by Micron; 03-29-2016 at 06:17 PM. Reason: hit save too soon!
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #18
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,929
    OP wants conditional formatting with more than three conditions (6 I believe) - so if the form is displaying 'one of each' three will revert to no formatting or be displayed up with the wrong format, although you can retrieve one as 'standard' formatting.

  4. #19
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,422
    Guessed I missed (and still don't see) where it was stated that all six conditions had to be possible at the same time but on different records.
    ok but how can I tell if (runselected) start with "g/" then color the runselected green or if start with "y" color yellow?
    The 'or' part says to me, ("on my continuous form" as OP said they had) and I'm making up my own combinations here:
    if the textbox starts with y, make the background yellow;
    if the textbox starts with r, make the background red;
    if the textbox starts with g, make the background green; etc., not
    if in one record it's y, make it yellow, but if in another record if it's r make it red.

    If that's your take, are you sure about that? Maybe the OP's limited experience has prevented them from picking up on something that's not required (because I can see why the posted solution would never work anyway)? Regardless of how many conditional format statements an Access version allows, I do not think it is possible to do so in a continuous form but I'm not sure. I'll take a whack at something but I may not be real quick. Maybe if the control called a function, it would be record-specific.

  5. #20
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,422
    OK, regardless of whose interpretation is correct, I did manage to fudge something. Here are six records with 6 different SystemID's and 6 different colors for textboxes. However, I was correct (and further research proved) that you cannot affect properties of one control without affecting all instances of it. Plus, any vba code to set more than 3 conditions in a version that does not allow it will fail. What I have here is 6 textboxes, each with their own single condition based on the value of SystemID.
    Click image for larger version. 

Name:	ContRecColours.jpg 
Views:	7 
Size:	43.2 KB 
ID:	24177

    Why there are six: I tried to set the data control bg color by referencing the conditional color result. As you mentioned, it either does it to all based on the first or last record value, or oddly enough, it changes as you scroll the records. If I try tricks like overlaying the main control (set as transparent) with these color boxes, whatever you do to their color or transparency property is again affected throughout all records. Same story if I called a function instead. Best I could arrive at is a way to flag the record with a colored box (at least more than 3 choices are possible). You can probably envision that if you remove the border, in this data example I'll have a set of colored blocks like a set of stairs. I guess that leaves some decision making to be done: forget about looking pretty and find some other way (message box?) to draw attention, use this method above, make do with 3 conditions or upgrade Access. This method can be shortened to 2 textboxes if one puts 3 conditions on each IF 6 conditions are needed.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #21
    barby.pava is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2016
    Posts
    11
    This was what i wanted Click image for larger version. 

Name:	Untitled.png 
Views:	4 
Size:	16.8 KB 
ID:	24180

    i was able to do it in a different way;
    in my runs table i add the field runcolor for each runs then in my form i created a bounded ole object with the dlookup i set it in the back of the run number and now every runs has the right color.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 11-28-2015, 12:00 PM
  2. update forms color change
    By trevor40 in forum Forms
    Replies: 2
    Last Post: 03-06-2014, 06:22 AM
  3. Change Change FormHeader Color
    By burrina in forum Forms
    Replies: 4
    Last Post: 12-19-2012, 08:18 PM
  4. Rainbow color effect on textbox highlighted text
    By DanielHofer in forum Forms
    Replies: 1
    Last Post: 08-31-2011, 08:14 AM
  5. Replies: 1
    Last Post: 10-22-2009, 03:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums