Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2014-09-05
5
229 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
ID: 40306174
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
ID: 40306202
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
ID: 40306232
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
ID: 40306267
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
ID: 40306290
Thank you, macarrillo.  Your suggestions worked perfectly!
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

839 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