Results 1 to 11 of 11
  1. #1
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    136

    Conditional Formatting Help


    Hi,
    I have a field on a form entitled "Current Printable NVA No" that I want to fill with a color when another field entitled "Sent to Mfg" is set to Yes. How do I do that in access?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Use Expression Is and a condition like:

    [Sent to Mfg] = True

    Spaces in field names aren't worth the bother in the long run, most of us avoid them (symbols as well). FYI, I deleted your duplicate thread. Welcome to the site.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    136
    Quote Originally Posted by pbaldy View Post
    Use Expression Is and a condition like:

    [Sent to Mfg] = True

    Spaces in field names aren't worth the bother in the long run, most of us avoid them (symbols as well). FYI, I deleted your duplicate thread. Welcome to the site.
    Thanks for the reponse. The "= True" statement doesn't work.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    What is the data type of that field? I assumed it was Yes/No. You have to test for whatever is actually stored in that field. If it's text, perhaps:

    [Sent to Mfg] = "Yes"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Hipromark is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2020
    Location
    Bogota, Colombia
    Posts
    15
    Quote Originally Posted by matey56 View Post
    Hi,
    I have a field on a form entitled "Current Printable NVA No" that I want to fill with a color when another field entitled "Sent to Mfg" is set to Yes. How do I do that in access?
    Do this: Create a Macro and use the if function, being the condition when "Sent to Mfg" is "Yes", then, within the if in the 'add new action' field write down SetProperty, then in 'Control name', put the name of the field which you want to change the color to, then in 'property' select BackColor and then in 'Value' introduce the Hex value. That should do it.

    Let me know if this worked for you.

  6. #6
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    136
    Quote Originally Posted by pbaldy View Post
    What is the data type of that field? I assumed it was Yes/No. You have to test for whatever is actually stored in that field. If it's text, perhaps:

    [Sent to Mfg] = "Yes"
    This worked, thanks! One more question - When I set the "Sent_to_Mfg" combo box to Yes, the color of the other field changes, but not until I hit refresh. How can I get it to change immediately?

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I would expect Conditional Formatting to react as soon as the control is updated. It isn't? Can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    136
    Quote Originally Posted by pbaldy View Post
    I would expect Conditional Formatting to react as soon as the control is updated. It isn't? Can you attach the db here?
    Yeah, it doesn't. What did you want to see? The Expression Is written as [Sent_to_Mfg]="Yes"

    It only colors the box in question when the control "Sent_to_Mfg" is selected as Yes then I hit refresh. I should actually probably mention the Yes/No combo box's Row Source is qklp_YES_NO. Maybe that's why?

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I wanted to be able to play with it. You can try this in the after update event of the combo:

    Me.Refresh
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    matey56 is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    136
    Quote Originally Posted by pbaldy View Post
    I wanted to be able to play with it. You can try this in the after update event of the combo:

    Me.Refresh
    Thanks, I actually just used a Refresh macro and it's working perfectly.

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Glad you got it working.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Conditional formatting
    By TGHMan in forum Forms
    Replies: 1
    Last Post: 06-16-2018, 12:46 AM
  2. Replies: 2
    Last Post: 11-12-2015, 10:46 AM
  3. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  4. Conditional Formatting
    By bellevue in forum Forms
    Replies: 4
    Last Post: 05-17-2012, 06:03 AM
  5. Conditional Formatting
    By DanOzDirect in forum Reports
    Replies: 3
    Last Post: 07-21-2010, 08:49 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