MS Access Report Get Value From Another Query

Thank you for looking at my question,

I have a report in MS Access comparing inventory and consumption that pulls from one query but I would like to pull one item in the report header , the date the inventory data was captured, from another query.

The inventory date is the only item in a query called qryInventoryDate

and in the data source property for the textbox I hoped would display this value I had typed a select query

= SELECT [qryInventoryDate]![Inventory Date] from [qryInventoryDate]


but when I try to run the report it is prompting me for a parameter value for inventory date.

Can I get this data to display in the header of my report and if so how do I achieve that please?
Gary CroxfordOperations Support AnalystAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
try using dlookup()

=dlookup("[Inventory Date]", "qryInventoryDate")

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PatHartmanCommented:
A query returns a recordset which is different from a single value.  That is why you can't just stick SQL expressions in controls.  Rey's suggestion of a DLookup() would work.  I'm pretty sure that Access is smart enough to run the query only once.  An alternative is to add the qryInventoryDate query to your RecordSource query.  No join lines.  This makes a Cartesian Product but since this is a report, it doesn't matter.  That way the column would be in the recordsource and you would just bind a control to it.
Gary CroxfordOperations Support AnalystAuthor Commented:
Rey, worked perfectly, thank you
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.