Connecting Tech Pros Worldwide Forums | Help | Site Map

adding data in a loop qry

Newbie
 
Join Date: Sep 2007
Posts: 23
#1: Jan 2 '08
Hopeful New Year:
for explanatory purposes- I am running a looped sql from two tables. One is clients and other is provider. The sql loops through the provider info entering client data. At the end of each provider my info is put in before the next loop with a different provider begins. So

With rst
If Not rst.BOF And Not rst.EOF Then
rst.MoveFirst
End If
Do Until rst.EOF
dim imp as string
*** what do I put here??? if rst!provider <> then
imp = rst!client & my name and info
else
imp = rst!client
end if

strcolumn3 = "select rst!provider & imp

sSQL = "INSERT INTO table3 ( column1) " _
& "VALUES('" & strColumn3 & "')"

db.Execute sSQL

rst.MoveNext
cnt = cnt + 1
Loop
It should look like this:
provider1
client 1
client2
my name and info
provider2
client 3
client 4
etc
my name and info
provider 3
client 5
etc

Newbie
 
Join Date: Sep 2007
Posts: 23
#2: Jan 3 '08

re: adding data in a loop qry


thanks anyway I got it
Reply


Similar Microsoft Access / VBA bytes