DaveLondon
Technical User
Hi there,
I'm using Acces 2000 and I currently have working code that moves though a record set:
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim strSql As String
Dim dataitem As String
strSql = "SELECT CODE FROM Qry_Unique_Stocks;"
Set db = CurrentDb
Set rs = db.OpenRecordset(strSql)
Do While Not rs.EOF
Set dataitem = strSql
'code to run the query will be here.
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Set db = Nothing
However I want to get the value of the record set into the variable dataitem for each value of the record set. dataitem will then be picked up by a query which runs before moving to the next value of the recordset.
I'm getting an object required error message at the line Set dataitem = strSql
Any advice is greatly received.
Many thanks,
Dave.
I'm using Acces 2000 and I currently have working code that moves though a record set:
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim strSql As String
Dim dataitem As String
strSql = "SELECT CODE FROM Qry_Unique_Stocks;"
Set db = CurrentDb
Set rs = db.OpenRecordset(strSql)
Do While Not rs.EOF
Set dataitem = strSql
'code to run the query will be here.
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Set db = Nothing
However I want to get the value of the record set into the variable dataitem for each value of the record set. dataitem will then be picked up by a query which runs before moving to the next value of the recordset.
I'm getting an object required error message at the line Set dataitem = strSql
Any advice is greatly received.
Many thanks,
Dave.