H
hannes
Dear All,
I am trying to figure out how I can handle multiple criterias for a While
.... Wend loop (maybe a Do ... Loop While would be better?). I am creating a
query in VBA which shall return SQL statements which are stored in a table
called "test1" with the field name "Code".
The code looks like this with one criteria:
While (rst.EOF = False)
strSQL = strSQL & rst!
I am trying to figure out how I can handle multiple criterias for a While
.... Wend loop (maybe a Do ... Loop While would be better?). I am creating a
query in VBA which shall return SQL statements which are stored in a table
called "test1" with the field name "Code".
The code looks like this with one criteria:
While (rst.EOF = False)
strSQL = strSQL & rst!
Code:
strSQL = strSQL & ", "
rst.MoveNext
Wend
Now I would like to have a second criteria for my While condition which I
could add with "And". Though my criteria is based on a field out of another
table called "test2" which is linked to table "test1" and which contains a
"field_ID" which acutally exist as primary key in table "test1". With a
normal SQL query I can query this, however I have no idea how to add this to
my VBA loop so I can restrict my inputs.... ???
Any help is deeply appreciated. Thanks