Results 1 to 4 of 4
  1. #1
    newbie is offline Advanced Beginner
    Windows XP Access 97
    Join Date
    May 2009
    Posts
    34

    Need Index Number for FormatConditions


    I have a continuous form where I have used conditional formatting to change the row color based off of the value in one control. I used custom colors, so I had to use a bit of VB to make that work. At the time I only needed three colors. Now I have added a fourth category, so I need to make use of the default option, but I cannot figure out what the index number is so that I can format it to the color I want. I used the below code for conditional format 1, 2, and 3. Does anyone know what the index is for the default?

    Me.Client_Name.FormatConditions(0).BackColor = RGB(184, 191, 47)
    Me.Client_Name.FormatConditions(1).BackColor = RGB(255, 239, 142)
    Me.Client_Name.FormatConditions(2).BackColor = RGB(114, 68, 96)

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    what do you mean by 'default'?? if you're using RGB to display colors, black is probably it, as it is denoted as:
    Code:
    rgb(0,0,0)
    if you know what color you want, why not just google out the chart? there are countless websites that give graphics that you can click on and get the rgb numbers associated with the color blend.

    additionally, the 'formatconditions' collection that you're talking about has 0 objects in it until you add some to it (I think). That's a user-defined availability, to developers for manipulation purposes.

  3. #3
    newbie is offline Advanced Beginner
    Windows XP Access 97
    Join Date
    May 2009
    Posts
    34
    I have no issue finding the RGB that I want. I have a color picker, google, or even going into PowerPoint give me that information. The problem is that the color I want is not part of the standard colors that are allowed in Access so I had to use VB coding to pull in the colors I wanted for condition 1, condition 2, and condition 3. I was just using plain white as my default color if none of my conditions were met. Now I want to change the default color to a custom color like I have for conditions 1, 2, and 3. I need the index number associated with the default do do this.
    Me.control.FormatConditions(index 0)= Format Condition 1
    Me.control.FormatConditions(index 1)= Format Condition 2
    Me.control.FormatConditions(index 2)= Format Condition 3
    Me.control.FormatConditions(index ?)= Default Formating

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by newbie View Post
    Now I want to change the default color to a custom color like I have for conditions 1, 2, and 3. I need the index number associated with the default do do this.
    Me.control.FormatConditions(index 0)= Format Condition 1
    Me.control.FormatConditions(index 1)= Format Condition 2
    Me.control.FormatConditions(index 2)= Format Condition 3
    Me.control.FormatConditions(index ?)= Default Formating
    [/quote]and I already told you that the collection has no items by default, thus there IS NO default index number. The only ones that are there are the 3 you created.

    I don't know how else to say it. that's it. and I hope I'm not wrong about this, but i looked at the help menu to verify it! good luck!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 10-11-2011, 01:43 PM
  2. Eerror No unique index found
    By newtoAccess in forum Database Design
    Replies: 4
    Last Post: 12-10-2010, 08:30 AM
  3. Table Without PK Switching My Index Orders
    By ajetrumpet in forum Access
    Replies: 5
    Last Post: 09-07-2010, 06:11 PM
  4. formatconditions.undelete?
    By bbeernaert in forum Programming
    Replies: 0
    Last Post: 08-26-2010, 05:42 AM
  5. Best Way to Return a Newly Created Index?
    By Jerimiah33 in forum Programming
    Replies: 5
    Last Post: 09-06-2006, 12:22 PM

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