ChrisOjeda
Programmer
I am trying to write code that will run a select query. I then wish to step through the records one at a time to pull some data from them and send it to Excel. I am having issues with running the query and stepping through... Please help. Also, can someone explain the parameters for opening a recordset (I can't get explanations in the object browser)...
My situation:
Access 2000
Query in same database named C-PRIME DAILY SUMMARY
Code below...
Dim cnCurrent As ADODB.Connection
Dim rstDailyDQ As ADODB.Recordset
Set cnCurrent = CurrentProject.Connection
Set rstDailyDQ = New ADODB.Recordset
rstDailyDQ.ActiveConnection = cnCurrent
rstDailyDQ.Open ("C-PRIME DAILY SUMMARY"
With rstDailyDQ
.MoveFirst
Do Until rrstDailyDQs.EOF
MsgBox (rstDailyDQ![DAYS DQ])
.MoveNext
Loop
.Close
End With
My situation:
Access 2000
Query in same database named C-PRIME DAILY SUMMARY
Code below...
Dim cnCurrent As ADODB.Connection
Dim rstDailyDQ As ADODB.Recordset
Set cnCurrent = CurrentProject.Connection
Set rstDailyDQ = New ADODB.Recordset
rstDailyDQ.ActiveConnection = cnCurrent
rstDailyDQ.Open ("C-PRIME DAILY SUMMARY"
With rstDailyDQ
.MoveFirst
Do Until rrstDailyDQs.EOF
MsgBox (rstDailyDQ![DAYS DQ])
.MoveNext
Loop
.Close
End With