Link to home
Start Free TrialLog in
Avatar of darwin072398
darwin072398

asked on

Select query in VB

I have written a select query that finds a count, how can I display this count in a message box to inform the user?
Avatar of MikeP090797
MikeP090797

rs.open "SELECT COUNT(*) AS C1 FROM Table1 WHERE ID>100"
msgbox rs!C1
Avatar of darwin072398

ASKER

Is rs a collection? please be more specific.
rs is the recordset you execute the query on. You didn't specify the data access method you are using, so that was a general example. Anyway, no matter what you are using, execute that statement, and you'll get the results.
When dim the rs as a recordset I still get error messages. rs.open will not work, nor will rs.openrecordset
What data access method are you using?
DAO/RDO/ADO?
Please paste your query as a comment here.
ASKER CERTIFIED SOLUTION
Avatar of setiawan
setiawan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
should be msgbox rs!x