global variable for access reports

I've inherited an access database.  it has lots of reports.  I have to make changes to some of the reports.  That changes I have to make are things like changing the names and titles of employees, like "Joe Smith, Director of Residential Service".    This is currently hardcoded in the reports.  Is there an easy way to feed this data from an access table or a global-type variable, so that the next time I only need to change the data in one place?
Who is Participating?
mbizupConnect With a Mentor Commented:
Use a textbox instead of a label.  The DLookup syntax goes in the Control Source property, including the = sign like this:

 = DLookup("HeaderInfo", "YourTable")
AccessGuy1763Connect With a Mentor Commented:
Yep!  You just need to declare them in a global Module.

If you have one already, you can put the global variables there or you can open the VB Editor and do Insert > Module.

Although it's not required, global variable declarations typically are found at the top of the Module, above any global functions or subroutines in the same Module.

So your declaration for the above variable might look like this:
Dim strDirOfResServ as string

Then you can set it in the same global module or anywhere else, since it's global:
strDirOfResServ = "Joe Smith, Director of Residential Service"

Now the part that might be a little tricky is that I think you'll need to use code to set the captions:
me.lblDirOfResServ.Caption = strDirOfResServ
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
you need to create a table with the names and title of the people.

use at least three fields as mentioned above
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

mbizupConnect With a Mentor Commented:
If this is a  titles/heading,  for your reports you can include it in a table and use the following as a controlsource property:

 = DLookup("HeaderInfo", "YourTable")

However, if you have an employees table and their positions/title are included in the employeeInfo table you might be able to work that information into the recordsource query of your report.
HLRosenbergerAuthor Commented:
For all 3 of these ideas, how do I then reference the data/field/variable inside the reports, in a simple label object?
Any of these ideas would use textboxes, I think.  The textbox control source gives you more flexibility than the caption property of a label.
HLRosenbergerAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.