E
Eka1618
Hello,
I have created an Append Query (qryAppendTests) that looks like the following:
INSERT INTO tblQueue ( REQUEST_NO, REQUESTOR, DUE_DATE, TEST_TYPE, CYCLE_NO,
TEST_ID )
SELECT tblTest.REQUEST_NO, tblRequest.EMP_ID, tblRequest.DUE_DATE,
tblTest.TEST_TYPE, tblTest.CYCLE_NO, tblTest.TEST_ID
FROM tblRequest RIGHT JOIN tblTest ON tblRequest.REQUEST_NO =
tblTest.REQUEST_NO
WHERE (((tblTest.REQUEST_NO) Like [forms].[frmRequestNumber].[REQUEST_NO]));
tblQueue has a composite PK that consists of Q_ID and Q_YEAR. I have created
a custom sequence on Q_ID when I am inside a form using the following code:
queueID = DMax("[QID]", "tblQueue", "[Q_YEAR] = " & Year(Date))
If Me.QID.Text = 0 Then
Me.QID.Text = queueID + 1
End If
My problem now is that when i run the query, it gives me append violations
because there is no value for the PK's in tblQueue because I am trying to do
it after i add the records.
I cannot use the AutoNumber data type for Q_ID because this field needs to
be set back to 1 often.
Does anyone have any sugestions on how I can combine these two methods
durring the INSERT?
~Erica~
I have created an Append Query (qryAppendTests) that looks like the following:
INSERT INTO tblQueue ( REQUEST_NO, REQUESTOR, DUE_DATE, TEST_TYPE, CYCLE_NO,
TEST_ID )
SELECT tblTest.REQUEST_NO, tblRequest.EMP_ID, tblRequest.DUE_DATE,
tblTest.TEST_TYPE, tblTest.CYCLE_NO, tblTest.TEST_ID
FROM tblRequest RIGHT JOIN tblTest ON tblRequest.REQUEST_NO =
tblTest.REQUEST_NO
WHERE (((tblTest.REQUEST_NO) Like [forms].[frmRequestNumber].[REQUEST_NO]));
tblQueue has a composite PK that consists of Q_ID and Q_YEAR. I have created
a custom sequence on Q_ID when I am inside a form using the following code:
queueID = DMax("[QID]", "tblQueue", "[Q_YEAR] = " & Year(Date))
If Me.QID.Text = 0 Then
Me.QID.Text = queueID + 1
End If
My problem now is that when i run the query, it gives me append violations
because there is no value for the PK's in tblQueue because I am trying to do
it after i add the records.
I cannot use the AutoNumber data type for Q_ID because this field needs to
be set back to 1 often.
Does anyone have any sugestions on how I can combine these two methods
durring the INSERT?
~Erica~