Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - 2 recordsets in a while loop
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

2 recordsets in a while loop

 Post Reply Post Reply
Author
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Topic: 2 recordsets in a while loop
    Posted: 04 April 2003 at 2:41am

do while NOT rs_issue.eof
do while NOT rs_receiving.eof

...

rs_receiving.movenext
LOOP
rs_issue.movenext
LOOP

Actually, how my syntax should be?

I would to loop within 2 table but I just get the rs_receiving right but still not both recordset.

Anyone knows how?

Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 04 April 2003 at 2:44am

i dont understand what you are trying to do.

Can you please give us some more details.

Back to Top
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Posted: 06 April 2003 at 7:01pm
What I really want is to generate a report from 2 table. But, since there is a need to sort those report and also I if I combine every tables together and with the conditions and order, it will be very very long.
Back to Top
Auritania View Drop Down
Newbie
Newbie


Joined: 09 April 2003
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Auritania Quote  Post ReplyReply Direct Link To This Post Posted: 10 April 2003 at 2:18pm
If it is an access database, use the graphical query builder till it works and then switch to SQL view and copy the statement over. Makes big, ugly complex SQL statments easy for those of us that are SQL challenged.
Back to Top
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Posted: 10 April 2003 at 7:51pm
I am using mysql
Back to Top
Coco Brown View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2002
Location: United States
Status: Offline
Points: 245
Post Options Post Options   Thanks (0) Thanks(0)   Quote Coco Brown Quote  Post ReplyReply Direct Link To This Post Posted: 11 April 2003 at 5:09pm

check that both your recordsets have records in them.  According to your code, if rs_issue has no records in it, then the rs_recieving loop will be ignored.  If the tables are relatively similiar, I would advise joining them or using UNION.  Otherwise, you would have to find a way to make sure that one recordset set keeps looping if you happened to reach the end of the other.

Try this:

Do while (rs_recieving.eof=false) OR (rs_issue.eof=false)
  if (rs_recieving.eof = false) then
        ...
       rs_recieving.movenext
  end if
  if (rs_issue.eof = false) then
        ...
      rs_issue.movenext
  end if
Loop

I haven't tested this, so I don't know if this will work.

Hope this helps  

Back to Top
ngaisteve1 View Drop Down
Groupie
Groupie
Avatar

Joined: 26 December 2002
Location: Malaysia
Status: Offline
Points: 169
Post Options Post Options   Thanks (0) Thanks(0)   Quote ngaisteve1 Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2003 at 2:18am
I am done with it already. Anyway, thanks.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.