I am new to Access VBA. I am having a problem passing values from an aggregate function query, ( Select Count([ID]) from tblWhatever) ) and I can't seem to figure out how to pipe the data to an array.
I.E.
dim sql as string
dim rst as adodb.recordset
dim cnn as adodb.connection
dim varsqlresults as variant
set cnn = currentproject.connection
set rst = new adodb.recordset
sql = "Select count([Id]) from tblMaster"
rst.open " " & sql & " ",cnn, adopendyanmic,adlockreadonly
varsqlresults = rst.getrows
msgbox (varsqlresults)
I recieve a type mismatch. (Understandable.) What I am trying to do is pull the results from the aggregate function query to a single dimension array and populate a text box with the value of that variable. Any Help would be GREATLY appreciated.
I.E.
dim sql as string
dim rst as adodb.recordset
dim cnn as adodb.connection
dim varsqlresults as variant
set cnn = currentproject.connection
set rst = new adodb.recordset
sql = "Select count([Id]) from tblMaster"
rst.open " " & sql & " ",cnn, adopendyanmic,adlockreadonly
varsqlresults = rst.getrows
msgbox (varsqlresults)
I recieve a type mismatch. (Understandable.) What I am trying to do is pull the results from the aggregate function query to a single dimension array and populate a text box with the value of that variable. Any Help would be GREATLY appreciated.