Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output Count in OK

Status
Not open for further replies.

seafuzz

Technical User
Jul 8, 2003
1
US
How do I write a Select statemet to output the couunt of records from a query in to a vbOK box. Below is the select statement I need the VBA code to make this hapen.


Select Count(Account) from [Print PCCs] as [Count of PCC]

Thanks
 
Hi,

First your Select statement is incorrect...
Code:
Select Count(Account) as [CountOfPCC] from [Print PCCs]
Second, the results are in your RecordSet object. You must assign the results of your query for the RecordSet object to a variable in order to use it.
Code:
With RecordSetObject
   .MoveFirst
   MyString = !CountOfPCC
End With
Hope this helps :)


Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top