You want to store the result of the select query in a variable? How many columns and rows in the select query results?
Assuming it is one column, one row, and I will assume it is an integer and the select query looks like:
"SELECT Count(ID) as IDCount FROM tblMyTable"
Dim sSQL As String
Dim rs As ADODB.Recordset
Dim iValue As Integer
sSQL = "SELECT Count(ID) as IDCount FROM tblMyTable"
Set rs = New ADODB.Recordset
rs.Open sSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly
iValue = rs("IDCount")
rs.Close
etc...
Did that help?
mmcdonal
Look it up at:
http://wrox.books24x7.com