Solved

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

Posted on 2014-09-05
5
230 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
[X]
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
  • 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.
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…

730 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