Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 622
  • Last Modified:

Displaying the result of SQL in msgbox

I have a table called tblCustomers with a field called CustomerBalance.

I have a form called "Form1" which has a button!

When I click on the button I want to display the result of "Select count(*) from tblCustomers where CustomerBalance > 0".

The result should be displayed via a msgbox.

I know this is easy but how do I do it??
0
Patrick O'Dea
Asked:
Patrick O'Dea
  • 2
1 Solution
 
Gustav BrockCIOCommented:
You could use DCount:

MsgBox "Count: " & DCount("*", "tblCustomers", "CustomerBalance > 0") & "."

/gustav
0
 
Patrick O'DeaAuthor Commented:
Thanks Gustav,

I had forgotten about DCount!
0
 
Gustav BrockCIOCommented:
You are welcome!

/gustav
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now