Results 1 to 4 of 4
  1. #1
    ortizgabe is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2014
    Posts
    8

    Trouble with expressions

    Hello,

    I am trying to create a conditional formatting expressing with multiple variables, but can get the last piece to fit. Basically I want a date field to turn red when one of two other fields is not present and if the date is overdue. The first field is a check box the other combo box. Here is the expression I thought I could use...

    IIf([Revocation Appealed]=False,"n") Or IsNull([Revocation Outcome]) And [Appeal By]<=Now()

    I want the outcomes to be:

    if checkbox is empty and combox box empty and date overdue = red
    if either the checkbox or combo box have values = black
    if checkbox empty and combo box is empty and date not overdue = black

    having either the checkbox or the combox box with values meets the criteria of the item not being overdue and I can get it to work with one or the other but not both... any help would be greatly appreciated!

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    In the report detail band, use the event ON PRINT, (use your text box names)

    Code:
    select case true 
      case not checkbox.value and isNull(cboBox) and txtDate > [targetDate]
           txtDate.ForeColor = vbRed
      case else
           txtDate.ForeColor = vbBLACK
    end select

  3. #3
    ortizgabe is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Jun 2014
    Posts
    8
    Oh Man, I was afraid it was going to involve coding. I am so new to Access and not familiar with coding at all, so I was hoping I could keep from having to go into the view code screen. I do appreciate your help though!

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    if checkbox is empty and combox box empty and date overdue = red
    if either the checkbox or combo box have values = black
    if checkbox empty and combo box is empty and date not overdue = black


    Conditional Formatting should be able to do this.

    Basically, the text color will be black unless:

    [Revocation Appealed]=False And IsNull([Revocation Outcome]) And [Appeal By]>=Now()
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. If Then Expressions?
    By FoxMan250 in forum Access
    Replies: 34
    Last Post: 05-08-2014, 12:30 PM
  2. Combine two Expressions into one?
    By drex in forum Queries
    Replies: 2
    Last Post: 04-08-2014, 08:51 AM
  3. Expressions in Form
    By Deb4566 in forum Access
    Replies: 7
    Last Post: 03-08-2013, 12:18 PM
  4. Queries, Look-up, and Expressions
    By Atlascycle in forum Queries
    Replies: 22
    Last Post: 02-28-2012, 06:40 AM
  5. Conditions / Expressions
    By Mark344 in forum Access
    Replies: 1
    Last Post: 02-19-2010, 08:15 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