SirDrinksalot
New member
- Local time
- Today, 03:32
- Joined
- Feb 17, 2006
- Messages
- 7
Hi all,
Quick question, and one that i think should have a simple answer. I want to run a SQL string within my VBA and analyse the resulting recordset, but I'm having problems. I can access the recordset in the following way:
However, I then need to loop through each record within the recordset, but using .movenext isn't working. My whole problem starts when i try to instantiate a database variable, problem being that I can't, it's not available. Also, if i try and create a recordset variable like so:
this returns a datatype mismatch!
Can anyone help me, this should be fairly starightforward (as in ADO)...
Quick question, and one that i think should have a simple answer. I want to run a SQL string within my VBA and analyse the resulting recordset, but I'm having problems. I can access the recordset in the following way:
Code:
intCounter = CurrentDb.OpenRecordSet(strSQL).RecordCount
strSourceID = strSourceID & Chr$(34) & CurrentDb.OpenRecordset(strSQL).Fields(0).Value & Chr$(34)
However, I then need to loop through each record within the recordset, but using .movenext isn't working. My whole problem starts when i try to instantiate a database variable, problem being that I can't, it's not available. Also, if i try and create a recordset variable like so:
Code:
set rsRecordSet = CurrentDb.OpenRecordset (strSQL)
this returns a datatype mismatch!
Can anyone help me, this should be fairly starightforward (as in ADO)...