K
kscheu via AccessMonster.com
How do I increment a variable field using a counter in a for loop
dim strsql as string
dim strsql1, strsql2, strsql3,strsql4,strsql5,strsql6 as string
' I have 6 filters and I am trying to create a sql string using a loop
strsql = "Select * from query where "
strsql1 = " [div] = " & Me.cboDiv
strsql2 = " [order] = " & Me.cboOrder
..
..
..
For intcnt = 1 To 6
If strsql&intcnt <> ""
strsql = strsql & strsql&intcnt
End If
Next
My sql should look like: Select * from query where [div] = " & Me.cboDiv and
[order] = " & Me.cboOrder
How can I do this using the for loop?
Thanks.
dim strsql as string
dim strsql1, strsql2, strsql3,strsql4,strsql5,strsql6 as string
' I have 6 filters and I am trying to create a sql string using a loop
strsql = "Select * from query where "
strsql1 = " [div] = " & Me.cboDiv
strsql2 = " [order] = " & Me.cboOrder
..
..
..
For intcnt = 1 To 6
If strsql&intcnt <> ""
strsql = strsql & strsql&intcnt
End If
Next
My sql should look like: Select * from query where [div] = " & Me.cboDiv and
[order] = " & Me.cboOrder
How can I do this using the for loop?
Thanks.