Results 1 to 3 of 3
  1. #1
    Susan Serbey is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2019
    Posts
    1

    Conditional formatting to a button

    Hi all
    Is it possible to add a conditional formatting to a button to change color?


    Thanks in advance

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    no. but you can change the color based on the data

    Code:
    select case txtBox.value 
    
    case "A"
    btn.backcolor = vbRed
    case "B" btn.backcolor = vbBlue
    end select

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    And it would have to be a Single View Form...not a Continuous View Form.

    To do it on a Continuous View Form...you'd have to use a Textbox, and its OnClick Event, tweaked to look like a Command Button...and then you would have to use Conditional Formatting.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 2
    Last Post: 11-12-2015, 10:46 AM
  2. conditional formatting
    By azhar2006 in forum Forms
    Replies: 4
    Last Post: 07-14-2014, 10:26 AM
  3. Conditional formatting
    By keiath in forum Forms
    Replies: 28
    Last Post: 01-27-2014, 08:36 AM
  4. Replies: 6
    Last Post: 05-26-2013, 09:10 PM
  5. Conditional Formatting a button?
    By smoothlarryhughes in forum Forms
    Replies: 4
    Last Post: 11-09-2012, 08:14 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