Sleekmac
Registered User.
- Local time
- Yesterday, 21:07
- Joined
- Sep 25, 2006
- Messages
- 34
OK I think this should be working, and I can't figure out why it isn't, maybe someone can see what I am missing here please?
What I am trying to do is isolate chunks of a table, and use each chunk as a recordset and do some rs.movelast, next, etc manipulations. I have a string array variable set and that seems to be the problem.
Option Compare Database
Option Base 1
Sub isolatebatch()
Dim ccy(89) As String
Dim x As Integer
Dim conn As ADODB.Connection
Dim rs As New ADODB.Recordset
ccy(1) = "ccy1"
ccy(2) = "ccy2"
'....
Set conn = CurrentProject.Connection
rs.ActiveConnection = conn
For x = 1 To 89
rs.Open "SELECT * FROM [Interp rates] WHERE [F1]= ccy(x) ORDER BY [F4]"
'[operations]
Next x
End Sub
It keeps saying that ccy(x) is an undefined function. This is not a function at all, but a variable, and I have clearly defined it as such above.
Any help would be appreciated!
What I am trying to do is isolate chunks of a table, and use each chunk as a recordset and do some rs.movelast, next, etc manipulations. I have a string array variable set and that seems to be the problem.
Option Compare Database
Option Base 1
Sub isolatebatch()
Dim ccy(89) As String
Dim x As Integer
Dim conn As ADODB.Connection
Dim rs As New ADODB.Recordset
ccy(1) = "ccy1"
ccy(2) = "ccy2"
'....
Set conn = CurrentProject.Connection
rs.ActiveConnection = conn
For x = 1 To 89
rs.Open "SELECT * FROM [Interp rates] WHERE [F1]= ccy(x) ORDER BY [F4]"
'[operations]
Next x
End Sub
It keeps saying that ccy(x) is an undefined function. This is not a function at all, but a variable, and I have clearly defined it as such above.
Any help would be appreciated!