Solved

Using Access 2010, how do I create a label that is based on this year?

Posted on 2014-09-05
5
226 Views
Last Modified: 2014-09-05
Hi,

I am trying to create report column labels based on the current year.
 1st label is current year - 3 years = 2011
  2nd label is current year - 2 years = 2012
  3rd label is current year - 1 year = 2013
  4th label is current year = 2014

Please keep in mind that I am a novice creating things in Access--I'll need specific directions on not only how to do it but where to put the formulas.  Thanks you very much!!

Pat
0
Comment
Question by:FFNStaff
  • 3
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
macarrillo1 earned 500 total points
Comment Utility
Labels are meant to be static.

You could try putting a formula in the Report Properties On Load event similar to the following:

=[DateColumn1_Label].[Caption]=CStr(Year(Now())-1)

Or the Page Header Event Properties on the On Format or On Paint Events.

Start by bringing up your report in Design view and looking at the Event Tab of the Report.
0
 
LVL 9

Expert Comment

by:macarrillo1
Comment Utility
Actually, looking at your problem again.

You can replace the label headings with Text Boxes and change the 'control source' (under Data tab) to something like

=Year(Now())-1

Then change the appearance of the text box so that it does not look like data entry. Under 'format' tab change 'Back Style' and 'Border Style' to 'Transparent'.
0
 

Author Comment

by:FFNStaff
Comment Utility
Your comment about labels being static made sense so I changed the format and used the date part of the formula -- and it worked!!  Thank you.
0
 
LVL 9

Expert Comment

by:macarrillo1
Comment Utility
Formulas would be:

=Year(Now())-3  1st label is current year - 3 years = 2011
=Year(Now())-2  2nd label is current year - 2 years = 2012
=Year(Now())-1  3rd label is current year - 1 year = 2013
=Year(Now())     4th label is current year = 2014

Instead of adding text boxes and deleting labels.  You can convert the existing labels. Right Click the old label and select 'Change to' and click 'Text Box'
0
 

Author Comment

by:FFNStaff
Comment Utility
Thank you, macarrillo.  Your suggestions worked perfectly!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now