1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access 2010 Date Field in Form Macro or ()Iff ??

Discussion in 'Business Applications' started by ncvet007, Feb 22, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. ncvet007

    ncvet007 Thread Starter

    Joined:
    Jan 28, 2011
    Messages:
    70
    I have a Date field in a Form. I want the Date to be appear in red when it is more than 6 months older than today's date. Where and how do I make that happen?
    Thanks
     
  2. Sponsor

  3. ncvet007

    ncvet007 Thread Starter

    Joined:
    Jan 28, 2011
    Messages:
    70
    I think I found my own answer. Use condition formatting. That works OK. But now, if I want another field to also appear in red should the above mentioned Date field be older than 6 months, how do I accomplish that?
     
  4. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,493
    The same way that you did it for the first field.
     
  5. ncvet007

    ncvet007 Thread Starter

    Joined:
    Jan 28, 2011
    Messages:
    70
    While the first one involved data from the field itself, the second example involves 2 fields.
    For instance: If DateField1 is older than today's date, then DataField2 is in a red colored font.
    Condition formatting won't work for this, will it?
    Thanks
     
  6. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,493
    It should, but put it in the field that you want to format.
     
  7. ncvet007

    ncvet007 Thread Starter

    Joined:
    Jan 28, 2011
    Messages:
    70
    You are correct, of course. It works.
    Thanks
     
  8. ncvet007

    ncvet007 Thread Starter

    Joined:
    Jan 28, 2011
    Messages:
    70
    Another Question: While I was able to do the Conditional Formatting I wanted, I had to make a DateField in the SubForm. Now the Date Fields are not linked. Before I added the DateField to the SubForm, I got error message "The object doesn't contain the Automation object "DateField". Is there a way I can use the DateField from the Form to satisfy the conditions of the Conditional Formatting in the SubForm?
     
  9. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,493
    You could try referring directly to the Mainform using the format
    = forms![mainform name]![field name]
    where mainform name is the actual name of your mainform and field name is name of the Datefield.
     
  10. ncvet007

    ncvet007 Thread Starter

    Joined:
    Jan 28, 2011
    Messages:
    70
    Thanks, I'll give that a try.
     
  11. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/982227