Report Header (1 Viewer)

BigJimSlade

Registered User.
Local time
Today, 03:39
Joined
Oct 11, 2000
Messages
173
Hey, Big Jim here!

I am trying to take a value from a single-rowed table and place it in my report header in a text box. I try to reference it in the Control Source, but I am having no luck. I am told that my field could refer to more than one table in my database. Oh, and it is sighting my table name as my field in the error message.

=[tablename].[Column] is how I tried setting it up.

Thanks for all your help in advance.

Big Jim
 

Atomic Shrimp

Humanoid lifeform
Local time
Today, 03:39
Joined
Jun 16, 2000
Messages
1,954
This sounds like something I had to do once; I had a table which only ever had a single row, in which I stored a number of system variables, such as last invoice number, system name etc.
I wanted to have the system name come out on the header of all of the reports, so I created a little subform, and inserted that into the headers, in order to make sure that, if anybody ever accidentally added a row to the system table, I would still be only looking at the first row, I put an autonumber field in, and specified =1 in the query (recordsource) criteria for the subform.

(does this make sense?)

Mike
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:39
Joined
Feb 19, 2002
Messages
43,392
The controlsource for a control must refer to a column from the report's recordsource or be a calculated value. To lookup data from a different table you can use the DLookup() function. Set the control source to:
=Dlookup(...)

Lookup the syntax for DLookup() in help.
 

BigJimSlade

Registered User.
Local time
Today, 03:39
Joined
Oct 11, 2000
Messages
173
Thanks Guys! You were both a big help. Big Jim got everything to work fine.
 

Users who are viewing this thread

Top Bottom