DaveLondon
Technical User
Hi there,
I'm trying to write a button click module in Access 2000 that will loop through all the records in a query. The code I have so far is:
Dim rs As Recordset
Dim strSql As String
strSql = "SELECT ISIN FROM Qry_Unique_Stocks;"
Set rs = DBEngine(0)(0).OpenRecordset(strSql)
Do While Not rs.EOF
Debug.Print rs!ISIN
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
I keep getting a type mismatch error. I've tried debugging the SQL but no joy
I know the content of the loop isn't doing much at the moment. It will eventually pass the value of ISIN into another query. Any help in getting this first part to work is greatly appreciated !
Cheers, Dave.
I'm trying to write a button click module in Access 2000 that will loop through all the records in a query. The code I have so far is:
Dim rs As Recordset
Dim strSql As String
strSql = "SELECT ISIN FROM Qry_Unique_Stocks;"
Set rs = DBEngine(0)(0).OpenRecordset(strSql)
Do While Not rs.EOF
Debug.Print rs!ISIN
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
I keep getting a type mismatch error. I've tried debugging the SQL but no joy
Cheers, Dave.