I have a copy query I created for users when they are creating similar records. This is supposed to help reduce input time into the system. The problem I am facing is that the copy query isn't working. Part of why I think it isn't working is because I have the auto number shut off on the primary key field. I did this because the autonumber was malfunctioning and even if I created a new table with all the information required of the original, eventually the error occurs again. So I shut the auto number off because the problem was that the auto number sometimes went back and grabbed a number it had previously used, thus creating duplicate values in the primary key field (which doesn't work).
The problem that I face is that now when I run the query is that nothing happens. The code I am running is simple enough. The second query updates the record to values it needs to have.
Here is the SQL of the CopyRecordPreviousTRQuery
If anyone could help me figure out why the copy query wont work it would be appreciated. Thank you.
The problem that I face is that now when I run the query is that nothing happens. The code I am running is simple enough. The second query updates the record to values it needs to have.
Code:
DoCmd.SetWarnings False
DoCmd.OpenQuery "CopyRecordPreviousTRQuery"
DoCmd.OpenQuery "PreviouSTestRequestUpdateQuery"
DoCmd.SetWarnings True
Here is the SQL of the CopyRecordPreviousTRQuery
Code:
INSERT INTO TestRequestTable ( TypeOfTest, Requestor, DateSubmitted, DateRequired, CatalogNumber, ComponentTested, IsSampleHere, SampleArrivalDate, WitnessTesting, ProjectNumber, TestCatagory1, TestCatagory2, SampleDisposal, PurposeOfTest, SpecialProcedures, IntervalsNumber, FolderHyperLink, IndividualComponent, ProjectManager, QualityAssuranceNumber, TestLocation, TestingElseWhere, TRNumber, IsSubmitted, Status, FolderMoved, Tech, Comment, TechnicianCompleted, TRNumberCounter, CompletedDate, Completed, TestRequestNumber )
SELECT TestRequestTable.TypeOfTest, TestRequestTable.Requestor, TestRequestTable.DateSubmitted, TestRequestTable.DateRequired, TestRequestTable.CatalogNumber, TestRequestTable.ComponentTested, TestRequestTable.IsSampleHere, TestRequestTable.SampleArrivalDate, TestRequestTable.WitnessTesting, TestRequestTable.ProjectNumber, TestRequestTable.TestCatagory1, TestRequestTable.TestCatagory2, TestRequestTable.SampleDisposal, TestRequestTable.PurposeOfTest, TestRequestTable.SpecialProcedures, TestRequestTable.IntervalsNumber, TestRequestTable.FolderHyperLink, TestRequestTable.IndividualComponent, TestRequestTable.ProjectManager, TestRequestTable.QualityAssuranceNumber, TestRequestTable.TestLocation, TestRequestTable.TestingElseWhere, TestRequestTable.TRNumber, TestRequestTable.IsSubmitted, TestRequestTable.Status, TestRequestTable.FolderMoved, TestRequestTable.Tech, TestRequestTable.Comment, TestRequestTable.TechnicianCompleted, TestRequestTable.TRNumberCounter, TestRequestTable.CompletedDate, TestRequestTable.Completed, TestRequestTable.TestRequestNumber
FROM ComponentTable INNER JOIN (CatalogNumberTable INNER JOIN TestRequestTable ON CatalogNumberTable.ID = TestRequestTable.CatalogNumber) ON ComponentTable.ID = TestRequestTable.ComponentTested
WHERE (((TestRequestTable.TestRequestNumber)=[Forms]![PreviousTestRequestForm]![TestRequestNumber]));
If anyone could help me figure out why the copy query wont work it would be appreciated. Thank you.