UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Specify Control Source For A Text Field On A Report, Access 2016    
 
   
RCDAWebmaster
post Feb 14 2020, 11:20 AM
Post#1



Posts: 86
Joined: 27-August 19



I have a report that is based upon a query. I'm now trying to display, in a in the header of the report, the criteria that were selected to generate the report. The criteria are placed in a temp table and available as a single row in a query. I added a text box to the report and trued specifying the control source: ="Report Criteria: " & query.field

When I run the query by itself, I get the value I want in the text box. when I load the report, the report prompts me for a value. Regardless of what I enter in the prompt, I get #Name? instead of the value in the query. How do I simply get the value from the query to display?

Should I retrieve the value from the query using a sub report? Can I put the sub report in the report header of the main report?
Go to the top of the page
 
theDBguy
post Feb 14 2020, 12:01 PM
Post#2


UA Moderator
Posts: 77,547
Joined: 19-June 07
From: SunnySandyEggo


Hi. Try using the DLookup() function to get the value from the query.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
RCDAWebmaster
post Feb 14 2020, 12:04 PM
Post#3



Posts: 86
Joined: 27-August 19



That's a great idea. Too bad I tried the sub report and found that it worked. I will try the Dlookup function and when it works use that as it's simpler and can get rid of a sub report.
Go to the top of the page
 
theDBguy
post Feb 14 2020, 12:05 PM
Post#4


UA Moderator
Posts: 77,547
Joined: 19-June 07
From: SunnySandyEggo


Right. There's always more than one way to get the same result in Access. Cheers!

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
RCDAWebmaster
post Feb 14 2020, 12:08 PM
Post#5



Posts: 86
Joined: 27-August 19



I'm always looking for the simplest solutions. (Best Practices)
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    26th February 2020 - 02:50 PM