vba loop

T

tinybears

Hoi,

Does anybody know how to make a loop in this example?

This is a snapshot of my code. I want a loop from 2002 to 2006, see the
letter i in my code, but this doesn't work. Does anyone have a clue?

Dim i As Integer

For i = 2002 To 2006

Set Algemene_solvabiliteitscoëfficiënt = DB.OpenRecordset("SELECT
Algemene_solvabiliteitscoëfficiënt FROM i ", dbOpenSnapshot)

Next i
 
B

Bob Phillips

Dim i As Integer

For i = 2002 To 2006

Set Algemene_solvabiliteitscoëfficiënt = DB.OpenRecordset("SELECT
Algemene_solvabiliteitscoëfficiënt FROM " & i, dbOpenSnapshot)

Next i


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

Hoi,

Does anybody know how to make a loop in this example?

This is a snapshot of my code. I want a loop from 2002 to 2006, see the
letter i in my code, but this doesn't work. Does anyone have a clue?

Dim i As Integer

For i = 2002 To 2006

Set Algemene_solvabiliteitscoëfficiënt = DB.OpenRecordset("SELECT
Algemene_solvabiliteitscoëfficiënt FROM i ", dbOpenSnapshot)

Next i
 
T

tinybears

Thx. This is my code now:

Dim i As Integer

For i = 2002 To 2006


Set Ticker = DB.OpenRecordset("SELECT Ticker FROM " & i & " Where
Ticker='" & CmbTickerlijst.Text & "'", dbOpenSnapshot)
 
Top