Results 1 to 4 of 4
  1. #1
    mlrucci is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2018
    Posts
    202

    conditional formatting in a list


    I have a form with a list. In that list, I have Employee names and dates based on a query. I want to know if there is a way to write a condtional so that if the date is >Date(), to turn red? I have done research and all I can find is condtionals for forms and reports. Any help would be appreciated.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    you cannot apply conditional formatting to a list box - use a subform instead, you can design it to look like a list box

  3. #3
    mlrucci is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2018
    Posts
    202
    thought about that, but I would like to click on the employee and open the employee's record.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    you can do that with either the click event for the displayed field or the subform current event - basically the same sql for the recordsource as you have for the listbox and for code as you have behind the listbox but reference the ID field whatever. e.g. based on listbox (and assumes ID is included as first field)

    sql for bot listbox and subform - SELECT ID, EmpName, SomeDate FROM tblEmployees

    listbox event - docmd.openform "empForm",,,,"ID=" & me.myListbox

    subform event - docmd.openform "empForm",,,,"ID=" & me.ID


    you will probably need to set the subform allow additions/filters/edits/deletions to false

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. Replies: 2
    Last Post: 10-09-2015, 12:11 PM
  3. conditional formatting
    By azhar2006 in forum Forms
    Replies: 4
    Last Post: 07-14-2014, 10:26 AM
  4. Replies: 16
    Last Post: 12-02-2013, 06:20 AM
  5. Replies: 6
    Last Post: 05-26-2013, 09:10 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