Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2011
    Posts
    57

    Unanswered: Subform Controls on Multiple Records Issue

    Hi,

    I have a form with a subform on it which is populated by a querydef built based on selections made on the two combo boxes on the main form. The values in the subform are all dates. While there are times when the subform returns a single value, there are other times when there are multiple records on the subform. My goal is to do some conditional formatting on the subform controls so that if the date < today's date, then that text box turns red, but if date on subform text box > today's date then that text box turns green.

    From what I have read so far, Access does not allow for controls on a subform to be treated separately, which is probably why all of the records on my subform reflect the colors based on my first record.

    Does anyone know a way around this feature of Access so that I can in fact treat each of the records as individual? Any help would be greatly appreciated as I have been struggling with this issue for a few days.

    Thanks in advance!

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You can do that using the Conditional Formatting feature. In Design View, Right-Click on a TextBox and select Conditional Formatting from the contextual menu.
    Have a nice day!

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by nic311 View Post
    ...From what I have read so far, Access does not allow for controls on a subform to be treated separately, which is probably why all of the records on my subform reflect the colors based on my first record...
    Actually, all of the Records reflect the Value in the Current Record, not necessarily the First Record. It's just that the First Record is the Current Record when the Form first opens. And, as Sinddho said, Conditional Formatting through the Menu is the only way to do this on Continuous or Datasheet View Forms.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Nov 2011
    Posts
    57
    I can't seem to find this conditional formatting on the menu when I right click a text box. I might mention that I'm using Access 97... could this be the reason that this option is not there?

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    That could be the reason indeed. I don't remember when this feature was introduced in Access but I would not be surprised to learn that it was in the 2000 version.
    Have a nice day!

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    That's correct. Here's a link I have archived that I nelieve provides a workaround for pre-2000 Access:

    Forms: Colors and Continuous forms

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •