Global variable for use in Reports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can I define a variable in the application, which I like to use as a Header
in reports? How do i do that?

Thanks in advance.
 
One approach is to create a table for this kind of thing, and use DLookup()
to read the value from the table.

Create a table named (say) tblConfig, with fields:
VarName Text the name to look up. Primary key
VarValue Text the value to return
Enter records such as:
CompanyName ABC Constructions

Now in your report you can place a text box that has this in its
ControlSource:
=DLookup("VarValue", "tblConfig", "VarName='CompanyName')

For more help with DLookup(), see:
http://allenbrowne.com/casu-07.html
 
Thanks a lot Allen.
--
Gopi


Allen Browne said:
One approach is to create a table for this kind of thing, and use DLookup()
to read the value from the table.

Create a table named (say) tblConfig, with fields:
VarName Text the name to look up. Primary key
VarValue Text the value to return
Enter records such as:
CompanyName ABC Constructions

Now in your report you can place a text box that has this in its
ControlSource:
=DLookup("VarValue", "tblConfig", "VarName='CompanyName')

For more help with DLookup(), see:
http://allenbrowne.com/casu-07.html
 
Back
Top