Bound Form Unrelated Query

Nicky

New member
Local time
Today, 16:04
Joined
Aug 21, 2012
Messages
6
I have a form that is bound to a Query. Obviously I can create a text box (or any other control) that has a control source to that query but I have a sum Query that delivers one amount and I would like to present that in a text box. How would i go about referencing that other query on this form?

Recap Form bound to query 1. text box on same form is to present data from query 2

Thanks
 
If the SumQuery just returns 1 value then in the ControlSource of the textbox put
Code:
=Dlookup("[Field]","[SUMQUERYNAME]")
OR
in the RowSource
Code:
SELECT [Field] FROM [SUMQUERYNAME];
However if there is more than 1 value returned you will need to include a WHERE statement in either code, like
Code:
]=Dlookup("[Field]","[SUMQUERYNAME]","[Field]='" & [Criteria] & "'")
 
Thanks so much for you expedience. I am sorry for the dumb question but i have been trying to learn this stuff on my own for years so I know a whole-lotta bits and pieces but the puzzle is missing some if you know I mean.


Your solution worked great but is only coming up as a number. I guess I assumed that the field would inherit the data type but it is not showing a dollar sign on the form. Should i convert the datatype in the code in the controlsource property or elsewhere and how would I do that? Again, thanks so much.
 
Just set the required format in the textbox properties window.
 

Users who are viewing this thread

Back
Top Bottom