Results 1 to 5 of 5
  1. #1
    hawkins is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    82

    Italicizing text after specific year

    I have a subreport based on a query that searches for the year and amps. I have them displayed in a text box and I was wondering how I could italicize the amps that are past a specific year, for example this year would be 2010. I have been using Year(Date())-1 for find that year but I was wondering how I could base italicizing the text box from that. Any suggestions will be greatly appreciated!

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    If they are separate records then in the report's ON FORMAT event you can put:
    Code:
    Me.FieldNameHere.FontItalic = (Me.FieldNameHere > Year(DateAdd("yyyy", -1, Date())))

  3. #3
    hawkins is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    82
    They are in the same record; would I then use
    Me.FieldNameHere.FrontItalic= (Me.FieldNameHere > Me.YearNameYear) ?

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by hawkins View Post
    They are in the same record; would I then use
    Me.FieldNameHere.FrontItalic= (Me.FieldNameHere > Me.YearNameYear) ?
    Yes, with one slight difference:

    Me.FieldNameHere.FrontItalic= (Me.FieldNameHere > Me.YearNameYear)

    Should be

    Me.FieldNameHere.FontItalic= (Me.FieldNameHere > Me.YearNameYear)

  5. #5
    hawkins is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    82
    thank you very much! worked perfect

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

Similar Threads

  1. Query Out Specific Text
    By ysabella in forum Queries
    Replies: 1
    Last Post: 11-19-2015, 03:53 AM
  2. Delete Specific Text Strings in a Field
    By JET in forum Queries
    Replies: 5
    Last Post: 08-25-2011, 03:33 PM
  3. Replies: 11
    Last Post: 06-02-2011, 10:21 AM
  4. Year to date sum
    By jzacharias in forum Database Design
    Replies: 6
    Last Post: 09-10-2010, 10:38 AM
  5. Text Box to show specific record
    By chu3w in forum Forms
    Replies: 1
    Last Post: 04-01-2010, 12:23 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