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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT STATEMENT

Status
Not open for further replies.

taqmeena

Programmer
Mar 22, 2005
53
PK
in Ms Access VB Code
i want to retrive total number of rows in from a table and store this count is some variable for further manuplation.

who can i do so.
for example:

DIM CNTR AS INTEGER

DoCmd.RunSQL "Select Count(*) from Student"

I want to store the query results in variable CNTR for further working in an event of a text field.

kindly tell me the method for query so that results are stored in a variable

thanking you in advance


 
You need to use a recordset

depending if you are using ado or dao see CurrentDB(), .OpenRecordset, Connection in help

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
CNTR = DCount("*", "Student")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top