Hi all,
Advice please on how I can, in VBA code, return a row count into an integer variable.
e.g.
======================
Sub something
dim dbs as variant
dim intRows as integer
dim strSQL as string
set dbs = currentdb
strSQL = "SELECT Count(*) AS intRows FROM tblX WHERE tblX.name = 'smith';"
dbs.execute strSQL
end sub
=============
I need to be able to get the count into 'intRows' but this code does not work.
Any help gratefully received.
John
Advice please on how I can, in VBA code, return a row count into an integer variable.
e.g.
======================
Sub something
dim dbs as variant
dim intRows as integer
dim strSQL as string
set dbs = currentdb
strSQL = "SELECT Count(*) AS intRows FROM tblX WHERE tblX.name = 'smith';"
dbs.execute strSQL
end sub
=============
I need to be able to get the count into 'intRows' but this code does not work.
Any help gratefully received.
John