A really easy way is to create a Module and put something like this into it:
- Option Compare Database
-
Option Explicit
-
Global Const mVersion = "3.017"
-
Public Function getVersion() As String
-
getVersion= mVersion
-
End Function
This creates a Constant and a function to return the value of that Constant. Then in your Report, you can drop a TextBox in the Header and set the ControlSource of the TextBox to something like
If you want to get tricky, you can use variables instead of constants:
- Option Compare Database
-
Option Explicit
-
Global gLongAppName As String
-
Global gShortAppName As String
-
Public Function getLongAppName() As String
-
getLongAppName = gLongAppName
-
End Function
-
Public Function getShortAppName() As Double
-
getShortAppName = gShortAppName
-
End Function
-
Public Function initDatabase() As Boolean
-
' This code is to be run when the database first loads.
-
' Called from an AutoExec Macro, or a Main Menu's OnLoad Event
-
gLongAppName = "The Long Name of your Application"
-
gShortAppName = "TLNA"
-
initDatabase = True
-
End Function
-
You can get even tricker if you want, by loading the Variables from values stored in a table. I can post an example of that if you need it.