[Z{Mod Edit: Removed duplicated information between merged posts}]
Hello friends
I have a form with Update buttons. When it is pressed, a query02 runs.
Source table: TEMPAY
Source field: QNO
Destination Table: PAYMENT125
Destination field: INSTNO
Query should check before Add record INSTNO <= QNO
if it is not <= query should not run
image of query is attached
[imgnothumb]http://bytes.com/attachments/attachment/6902d1360994066/append-query.jpg[/imgnothumb]
Here is the SQL for friends to correct it.
My database is also attached in zip format. QUERY02 needs to be correction.
Hello friends
I have a form with Update buttons. When it is pressed, a query02 runs.
Source table: TEMPAY
Source field: QNO
Destination Table: PAYMENT125
Destination field: INSTNO
Query should check before Add record INSTNO <= QNO
if it is not <= query should not run
image of query is attached
[imgnothumb]http://bytes.com/attachments/attachment/6902d1360994066/append-query.jpg[/imgnothumb]
Here is the SQL for friends to correct it.
Code:
INSERT INTO [PAYMENT 125]
( CODE125, INSTNO, [DATE], AMOUNT )
SELECT TEMPAY.CODE125, TEMPAY.QNO,
TEMPAY.QDATE, TEMPAY.QAMOUNT
FROM TEMPAY
INNER JOIN [PAYMENT 125]
ON
TEMPAY.CODE125 = [PAYMENT 125].CODE125
GROUP BY TEMPAY.CODE125, TEMPAY.QNO,
TEMPAY.QDATE, TEMPAY.QAMOUNT
HAVING (((TEMPAY.CODE125) Is Not Null)
AND ((TEMPAY.QNO) Is Not Null)
AND ((TEMPAY.QDATE) Is Not Null)
AND ((TEMPAY.QAMOUNT) Is Not Null));
Comment