select sql

  • Thread starter Thread starter EMILYTAN via AccessMonster.com
  • Start date Start date
E

EMILYTAN via AccessMonster.com

This line of code will give me the partnumber = 0001, 0001, 0002

Code:
------------------------------------------------------------------------------
--

mySQL5 = "SELECT qryOld.PartNumber FROM ([SELECT Incoming.PartNumber,
I_AvailableQty FROM Incoming WHERE Incoming.I_DespatchNote_Invoice='" & strMO
& "']. as qryOld) LEFT JOIN ([SELECT WIPRawDetails.PartNumber FROM
WIPRawDetails WHERE WIPRawDetails.JobNumber='" & strJobNumber & "' ]. as
qryNew) ON qryNew.PartNumber = qryOld.PartNumber WHERE (((qryNew.PartNumber)
Is Null)) "myrecset5.Open mySQL5
------------------------------------------------------------------------------
--


The following line of code will select all where part number = 0001---> means
2 record..

Code:
------------------------------------------------------------------------------
--

mySQL05 = "SELECT Incoming.PartNumber, I_AvailableQty, I_Bil FROM Incoming
WHERE Incoming.PartNumber='" & myrecset5!PartNumber & "'" myrecset05.
Open mySQL05
------------------------------------------------------------------------------
--


How am I suppose to let it select 1 record of 001 first then execute and then
select another 001?
Thanks
 
Hi Emily,

I think you are asking how to process each of the two records returned.
Easy, use a loop.

do while not myrecset05.eof
' Process the record

myrecset05.movenext
loop


Hope this helps.

Damian.
 
I do accordingly but can't get what I want....
It will select all 0001....then directly insert 3 records....
I want it to insert 1 by one
Damian said:
Hi Emily,

I think you are asking how to process each of the two records returned.
Easy, use a loop.

do while not myrecset05.eof
' Process the record

myrecset05.movenext
loop

Hope this helps.

Damian.
This line of code will give me the partnumber = 0001, 0001, 0002
[quoted text clipped - 27 lines]
select another 001?
Thanks
 
Back
Top