Results 1 to 7 of 7
  1. #1
    Lounger
    Join Date
    Mar 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form background color depending on criteria (2000)

    Oops! I posting this again because half of it was in yellow before.

    I have a subform in a form where if the field Presence equals Absent, I want the backcolor of the form to be gray, and if Present, I want it to be a light yellow. I've tried two different ways to do this and have problems with both.

    First way - I created a unbound text box and formatted it with

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form background color depending on criteria (2000)

    Although you don't state it explicitly, I assume your subform is a continuous form.

    Your first method will work with black, white, red, green, blue, cyan, magenta and yellow. Note: since <!t>[yellow]<!/t> is also a Lounge tag to indicate yellow text, your other post became hard to read <img src=/S/grin.gif border=0 alt=grin width=15 height=15>. To insert <!t>[yellow]<!/t> into a post, use the Tag tags available in the 1-Click TagPanel. To display <!t>[yellow]<!/t> in a post, I inserted <!t>[t]<!/t>yellow<!t>[/t]<!/t> (now think about what I inserted to display that!)

    The second method won't work. See <post#=238996>post 238996</post#> and the following posts in that thread for an explanation, and some alternatives.

  3. #3
    Lounger
    Join Date
    Mar 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form background color depending on criteria (2000)

    Thanks! Since the colors are limited on my method one, I'll look at that post for ideas on my second method.

  4. #4
    Lounger
    Join Date
    Mar 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form background color depending on criteria (2000)

    I looked at this post, and it seems like I have the colors working, but I can't edit the records. Your detailed explanation on how to do this was great! Using this explanation, I

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form background color depending on criteria (2000)

    In step 3, you open CodesVote in design view, and in step 4, you add ColorIndex. Shouldn't that be the RoosterVote table?

    Do you have a primary key in CodesVote and in RoosterVote? If so, on what field(s)?

  6. #6
    Lounger
    Join Date
    Mar 2003
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form background color depending on criteria (2000)

    I do not have a primary key in either table - CodesVote or RoosterVote. I'm not sure why I never put one in, especially in RoosterVote.

    And I'm confused about the 1st part of your question. My thinking is (I hope I can explain this right): In your post 239259 (re: post 239239), their tlkpOrderStatus (my CodesVote) was a lookup table that linked their codes to the colors, and their tblMaster (my RoosterVote) was the actual table with the data. So, in the query, the lookup table is linked to the colors by the color code, and the data table is linked to the lookup table by a code other than the color, but the color comes from the field ColorIndex in the lookup table. (I hope you understand what I just typed, because it confuses me just to read it over.)

    The colors do work, I just can

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Form background color depending on criteria (2000)

    Hi,

    OK, linking the color table to the lookup table is reasonable, but then I don't understand why you use the main table in steps 12 through 17.

    The reason that your query is not updateable is that Access can't decide what kind of link you have between the main table and the lookup table. The linking field in the lookup table should be the primary key of that table. In this case, if I understand your setup correctly, the VoteCodeNumber field in CodesVote should be the primary key. that should make the query updateable. Don't hesitate to post back if it doesn't, if possible with more detail.

    PS: There are two forms of "live" links to posts; you can type them in yourself or get them from the 1-Click TagPanel (to the right of the subject box). Also see <!help=19>Help 19<!/help>.
    The simple form is <!t>[post#=239259]<!/t>, resulting in <post#=239259>post 239259</post#>.
    The longer form is <!t>[post=A very interesting post,239259]<!/t>, resulting in <!post=A very interesting post,239259>A very interesting post<!/post>.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •