Form field displayes results of Query

G

Guest

I would like to appologise to start with, I think I'm having a really bad day.
I have a query that displays the required answer. I want to press a command
button on my form and have a field display the result from my query?

Not normalised!!!

Query2
Result is in field "SumOfOPENQTY"

Command button is on form "Wave Release Screen" and called "Command157".
The field it should display the results of the query in is "Total Units"

Help, please

Thanks
Dean
 
B

Bob Quintal

I would like to appologise to start with, I think I'm having a
really bad day. I have a query that displays the required
answer. I want to press a command button on my form and have
a field display the result from my query?

Not normalised!!!

Query2
Result is in field "SumOfOPENQTY"

Command button is on form "Wave Release Screen" and called
"Command157". The field it should display the results of the
query in is "Total Units"

Help, please

Thanks
Dean
"How shall I run thee, Let me count the ways."

if the query returns 1 row with 1 column, a DLookup would be the
simplest way.
in the button's OnClick Event, this is all you need.
Me.[Total Units] = Dlookup("SumOfOpenQty","Query2")

opening a recordset in code and returning the value would be
another way.

If the query returns several rows, with a classifier and the
sum, you could add a subform control, use the query as the
SourceObject and simply issue a me.subformname.requery in the
button's OnClick event
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top