Share via

Using Conditional Formatting on Access Continuous Form

Anonymous
2022-01-18T02:49:05+00:00

I have a continuous form which displays appointments and appointment dates.

Any way to display the text color for record based on the record's date?

Example:

1/17/2022

1/17/2022

1/18/2022

1/19/2022

1/19/2022

James

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2022-01-19T15:41:43+00:00

Actually I only need 2 colors as long as they're alternating.

Are the dates an unbroken sequence?  If so you can use the Mod operator in the conditional formatting  expression:

   [Appointment Date] Mod 2 = 0

If there are gaps in the sequence however, then you'll need to build a more complex expression which evaluates to True if the difference between the date and the last previous date to it is zero.  For this the primary key will need to be brought into play so that the expression does not compare the current date with itself if the dates are the same.  The rows would need to be ordered in date then primary key order, so that for rows of the same date the previous row will have a lower primary key value.  You can then use the DMax function to get the date which is <=the current date, and the primary key is less than the current key if the dates are the same.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

12 additional answers

Sort by: Most helpful
  1. Duane Hookom 26,825 Reputation points Volunteer Moderator
    2022-01-18T20:37:37+00:00

    The DBGuy was simply asking which part of conditional formatting you needed assistance to accomplish.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2022-01-18T18:09:43+00:00

    If I knew the answer why would I have asked?

    Was this answer helpful?

    0 comments No comments
  3. HansV 462.6K Reputation points
    2022-01-18T10:21:06+00:00

    Create two rules:

    Was this answer helpful?

    0 comments No comments
  4. DBG 11,711 Reputation points Volunteer Moderator
    2022-01-18T09:01:47+00:00

    Hi James,

    Sounds like you already knew the answer, which is Conditional Formatting. What exactly do you need help with? Do you know how to use/create conditional formatting?

    Was this answer helpful?

    0 comments No comments