View Full Version : Okay SQL whizards....


nelslynn
12-13-2001, 09:01 PM
I am trying to match two stock transactions, both transNo's come from tblTransactions. I want to update the tblClosedTrans with the buy trans# and the selltran#. The query I have set up doesn't work (too few parameters) Here is what I have...

INSERT INTO tblClosedTrans ( lOpenTransNo, lClosedTransNo )
SELECT T.tTransNo, T.tTransNo
FROM tblTransaction AS T
WHERE (T.tTransNo)=[Forms]![frmOpenBuys]![txtTransNo] And [Forms]![frmOpenBuys]![chkBox]=Yes AND (T.tTransNo)=[Forms]![tblTransaction]![txtTransNo]);

Yes, I pretty much knew this wasn't going to work. I don't know how to match up the OpenTransNo and closeTransNo.... they are coming from the same table matching up with field from two forms..yes, both forms are open.

lOpenTransNo ----> comes from (T.tTransNo)=[Forms]![frmOpenBuys]![txtTransNo] And [Forms]![frmOpenBuys]![chkBox]=Yes

lClosedTransNo ---> comes from (T.tTransNo)=[Forms]![tblTransaction]![txtTransNo])

Thanks for the help. This forum rocks.