Getting value from query before report opens

RexesOperator

Registered User.
Local time
Today, 17:51
Joined
Jul 15, 2006
Messages
604
I have a text box in a report whose value changes depending on the date in the query.

I can get the value from the query before the report opens from an open form. And then I open the report and get the date from the form.

Is it possible to get the value from the query without opening a form first?
 
If I'm following you, yes... One way to do this is to just put a dlookup in the textbox's control source property.

Code:
=DLookup("DatefieldName","QueryName","fieldName=X")
Regards,
Tim
 
I'm not sure how this helps. Can I put this on the on open-event of the report to make the value available to the report?
 
Sorry, I simply don't understand what you're trying to do... Just tested this in Northwind: When I put an unbound textbox on a report and add a DLookup function to that textbox's control source property...

Code:
=DLookUp("categoryName","categories","categoryId =1")

...I see a value in that textbox...the value is drawn from a query named categories...the same query, in this case, that the report is based on...

Not sure about using code in the report's open event to also do this...would have to test it.

Regards,
Tim
 
I found another work around. Not as elegant, but it does work, which is what matters.
 

Users who are viewing this thread

Back
Top Bottom