standard statment for all reports

  • Thread starter Thread starter Junior
  • Start date Start date
J

Junior

I need to place a standard information security statement on all pages of
all reports in a mdb.
is there a better way than simply copy/pasting the label in each report page
section?
 
I need to place a standard information security statement on all pages of
all reports in a mdb.
is there a better way than simply copy/pasting the label in each report page
section?

Here is an easy method. It allows for easy changing of the text when
needed.

Add a new table to the database.
Add one Field to the table, Memo datatype.
Name the field StandardText
Name the table "tblStandardText".

Paste the Standard Text into the field.

In the Report, add an unbound Control to the Page Footer (or wherever
you want to show the text).
Name this control "ShowText".

Code the Report's Declaration section:
Dim strText as String.

Code the Report's Open event:
strText = DLookUp("[StandardText]","tblStandardText")

Code the Report Header Format event:
[ShowText] = strText

Whenever you need to update or alter the text, simply edit the field
in the table, (using a form of course).
 
Fred,
Is there a reason why you wouldn't just have a text box with a control
source of
= DLookUp("[StandardText]","tblStandardText")


--
Duane Hookom
MS Access MVP


fredg said:
I need to place a standard information security statement on all pages of
all reports in a mdb.
is there a better way than simply copy/pasting the label in each report
page
section?

Here is an easy method. It allows for easy changing of the text when
needed.

Add a new table to the database.
Add one Field to the table, Memo datatype.
Name the field StandardText
Name the table "tblStandardText".

Paste the Standard Text into the field.

In the Report, add an unbound Control to the Page Footer (or wherever
you want to show the text).
Name this control "ShowText".

Code the Report's Declaration section:
Dim strText as String.

Code the Report's Open event:
strText = DLookUp("[StandardText]","tblStandardText")

Code the Report Header Format event:
[ShowText] = strText

Whenever you need to update or alter the text, simply edit the field
in the table, (using a form of course).
 
Fred,
Is there a reason why you wouldn't just have a text box with a control
source of
= DLookUp("[StandardText]","tblStandardText")

It certainly could be placed in the control source.
I might be incorrect in this assumption, but wouldn't that DLookUp
then have to be run each time a new page was formatted, as opposed to
having the Lookup run just once in the Open event, and it's value
assigned just once in the Header event.
 
Good point. I missed or ignored the all pages.

Another method would be to place the one record table in the report's record
source and include the field. This would not need Dlookup() or any code.

--
Duane Hookom
MS Access MVP


fredg said:
Fred,
Is there a reason why you wouldn't just have a text box with a control
source of
= DLookUp("[StandardText]","tblStandardText")

It certainly could be placed in the control source.
I might be incorrect in this assumption, but wouldn't that DLookUp
then have to be run each time a new page was formatted, as opposed to
having the Lookup run just once in the Open event, and it's value
assigned just once in the Header event.
 
Thanks - good discussion and learned something new
Duane Hookom said:
Good point. I missed or ignored the all pages.

Another method would be to place the one record table in the report's
record source and include the field. This would not need Dlookup() or any
code.

--
Duane Hookom
MS Access MVP


fredg said:
Fred,
Is there a reason why you wouldn't just have a text box with a control
source of
= DLookUp("[StandardText]","tblStandardText")

It certainly could be placed in the control source.
I might be incorrect in this assumption, but wouldn't that DLookUp
then have to be run each time a new page was formatted, as opposed to
having the Lookup run just once in the Open event, and it's value
assigned just once in the Header event.
 
Back
Top