In VBA, how run SQL and get a SUM result ?

  • Thread starter Thread starter Ryan
  • Start date Start date
R

Ryan

I need to run an SQL which returns a SUM of a column. I
don't need a recordset. How do I do this. I looked
everywhere and tried everything I can think of and nothing
works so far.
I need to do this from VBA and I need the result in a
variable so I can show it on a form.
I need the quickest way to do this as it will be done very
often by mutliple users.
 
Try...

TextBox.value = DSum("Fieldname","tablename","criteria if
necessary")
 

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

Similar Threads

Running sum 5
Summing multiple fields 2
SUM in a UNION query 2
SQL vs. VBA 5
Running sum major problem 22
run multiple queries in VBA 5
SQL Group and Sum Question 3
Excel Sum numbers in cells that also contain text 34

Back
Top