Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Year in header
Colin Smyth 
      
2 years ago
I have a form that I use with my bird database. I have a form that shows the birds that have been seen for the year. The header caption says Bird list for the year and I have tried to have the appropriate year added to the header caption without success.

I have attached a copy of the main form. In the centre of the form is an unbound text box where the year can be entered - the name of the field where the year is entered is called YearEnter.

I then use the query that I have attached to detect the year and everything works fine. When I then add to the caption heading under the form properties  ="Bird List for the year" & YearEnter I end up with the heading as per form attached.

I am not sure what I am doing incorrectly
Colin Smyth OP  @Reply  
      
2 years ago

Colin Smyth OP  @Reply  
      
2 years ago

Colin Smyth OP  @Reply  
      
2 years ago

Kevin Robertson  @Reply  
          
2 years ago
Either use a Text Box or set the Label caption using VBA.
Kevin Robertson  @Reply  
          
2 years ago

Colin Smyth OP  @Reply  
      
2 years ago
Hi Kevin. Thank you. So when I enter the following in the Header Caption property: ="Bird List for Year" &  Forms!frmWelcomeYearReports!YearEnter - all of that shows up in the header caption box
The text box where I enter the year is called YearEnter.
It picks the birds for that year but is not including the year in the Header Label.
Can you explain what your two other lines mean, ie Text Box - 2024 and Label (VBA) - 2024
Sorry to be a bit slow on the uptake - thank you for your patience
Kevin Robertson  @Reply  
          
2 years ago
The first is a label with the caption set in the Property Sheet (this is what you did).

The second is a Text Box with this in the Control Source:
    ="Text Box - " & [Forms]![SetYearF]![TargetYear]

The third is a Label with the following VBA in the Load event:
    lblHeader.Caption = "Label (VBA) - " & Forms!SetYearF!TargetYear
Colin Smyth OP  @Reply  
      
2 years ago
Thank you Kevin. I used the 2nd option and it worked. I really appreciate your assistance.
Just out of curiosity - with your third option - do you need to include the (VBA) in the code?
Many thanks. Colin
Kevin Robertson  @Reply  
          
2 years ago
No (VBA) is part of the text string. I only added it for display purposes.
Great you got it working.

A quick note: since you used the Text Box option. You will still be able to click on it.
Set Enabled to No.
Set Locked to Yes.
Colin Smyth OP  @Reply  
      
2 years ago
Thank you again. Really appreciate it. Has solved a problem that I had for ages.
Colin Smyth OP  @Reply  
      
2 years ago
Hi Kevin. I can not find the option to change "Locked". Found enabled but not the other. Thanks
Alex Hedley  @Reply  
            
2 years ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/7/2026 3:42:05 AM. PLT: 1s