J
joan
Hi there,
I hope someone can help with this, I'm at my wits end. I
am trying to insert records into a Receipts and
ReceiptsLine tables based on the user pressing a cmd
button on the PO. I'd like to insert records only based
on the PONumber the user is currently on. What is
happening is I am getting a parameter window asking for
Me.PONumber for each of the following SQL statements.
Also the ReceiptLines statement is inserting in
additional records i.e. POLine has 1 record and the
receipt will have 3 all the same part?! I thought I had
this working, but every change brings on new issue!
Sorry for length of msg, just wanted to give all info I
could. HELP!!! thx in advance.
Function Receipt()
Dim SQLReceipt As String
Dim SQLReceiptLine As String
SQLReceipt = "INSERT INTO tblReceipts ( SupplierID,
PONumber ) " & _
"SELECT tblPOHeader.SupplierID, tblPOHeader.PONumber " & _
"FROM tblPOHeader INNER JOIN tblPOLine ON
tblPOHeader.PONumber = tblPOLine.PONumber " & _
"GROUP BY tblPOHeader.SupplierID, tblPOHeader.PONumber,
[tblPOHeader]![Post] " & _
"HAVING (((tblPOHeader.PONumber)= Me.PONumber) AND
(([tblPOHeader]![Post])<>True))"
DoCmd.RunSQL SQLReceipt
SQLReceiptLine = "INSERT INTO tblReceiptsLine ( ItemNo,
QtyRecd, PONumber, ItemDesc, ReceiptNo ) " & _
"SELECT tblPOLine.Description, tblPOLine.QtyOrdered,
tblPOLine.PONumber, tblItemMaster.Description,
tblReceipts.ReceiptNo " & _
"FROM tblReceipts, (tblPOHeader INNER JOIN tblPOLine ON
tblPOHeader.PONumber = tblPOLine.PONumber) INNER JOIN
tblItemMaster ON tblPOLine.Description =
tblItemMaster.ItemNo " & _
"WHERE (((tblPOLine.PONumber)= Me.PONumber))"
DoCmd.RunSQL SQLReceiptLine
I hope someone can help with this, I'm at my wits end. I
am trying to insert records into a Receipts and
ReceiptsLine tables based on the user pressing a cmd
button on the PO. I'd like to insert records only based
on the PONumber the user is currently on. What is
happening is I am getting a parameter window asking for
Me.PONumber for each of the following SQL statements.
Also the ReceiptLines statement is inserting in
additional records i.e. POLine has 1 record and the
receipt will have 3 all the same part?! I thought I had
this working, but every change brings on new issue!
Sorry for length of msg, just wanted to give all info I
could. HELP!!! thx in advance.
Function Receipt()
Dim SQLReceipt As String
Dim SQLReceiptLine As String
SQLReceipt = "INSERT INTO tblReceipts ( SupplierID,
PONumber ) " & _
"SELECT tblPOHeader.SupplierID, tblPOHeader.PONumber " & _
"FROM tblPOHeader INNER JOIN tblPOLine ON
tblPOHeader.PONumber = tblPOLine.PONumber " & _
"GROUP BY tblPOHeader.SupplierID, tblPOHeader.PONumber,
[tblPOHeader]![Post] " & _
"HAVING (((tblPOHeader.PONumber)= Me.PONumber) AND
(([tblPOHeader]![Post])<>True))"
DoCmd.RunSQL SQLReceipt
SQLReceiptLine = "INSERT INTO tblReceiptsLine ( ItemNo,
QtyRecd, PONumber, ItemDesc, ReceiptNo ) " & _
"SELECT tblPOLine.Description, tblPOLine.QtyOrdered,
tblPOLine.PONumber, tblItemMaster.Description,
tblReceipts.ReceiptNo " & _
"FROM tblReceipts, (tblPOHeader INNER JOIN tblPOLine ON
tblPOHeader.PONumber = tblPOLine.PONumber) INNER JOIN
tblItemMaster ON tblPOLine.Description =
tblItemMaster.ItemNo " & _
"WHERE (((tblPOLine.PONumber)= Me.PONumber))"
DoCmd.RunSQL SQLReceiptLine