A
ajbarilla
I am having problems opening a recordset within a loop. Below is my
code and I get a compile error (End if without block if) when I try to
run it. The loop and recordset code work independently but not
togother. The code is to merge several documents based on ones that
are selected in a list box. the code below contains just the begining
of the merge not the entire merging process.
For intCurrentRow = 0 To ctlSource.ListCount - 1
If ctlSource.Selected(intCurrentRow) Then
SearchCrit = List0.ItemData(intCurrentRow)
Set rst = db.openrecordset("SELECT * FROM tblDocumentList WHERE
tbldocumentlist.[Document] = '" & SearchCrit & "'")
With rst
docpath = !location
rst.Close
End If
Next intCurrentRow
code and I get a compile error (End if without block if) when I try to
run it. The loop and recordset code work independently but not
togother. The code is to merge several documents based on ones that
are selected in a list box. the code below contains just the begining
of the merge not the entire merging process.
For intCurrentRow = 0 To ctlSource.ListCount - 1
If ctlSource.Selected(intCurrentRow) Then
SearchCrit = List0.ItemData(intCurrentRow)
Set rst = db.openrecordset("SELECT * FROM tblDocumentList WHERE
tbldocumentlist.[Document] = '" & SearchCrit & "'")
With rst
docpath = !location
rst.Close
End If
Next intCurrentRow