Here is my current roadblock!
The table tabCaseFileSuspects contains all the suspects related to a case. When I open another Investigation (many investigations to one case file) I need to insert the existing suspect(s) information into the new investigation. Because there can be different suspects applied to different investigations within the same case file, I use another table tabInvestigationSuspects.
The form that I use to enter a new investigation has the vCaseFileNumber, vInvestigationNumber and vDateCaseOpened data that needs to be inserted. What I need help with is getting the SuspectID and SuspectType from the tabCaseFileSuspects to the tabInvestigationSuspects where the case file numbers are the same. I think I’m close but when to use quotes, etc still baffles me. The following code is one line in my AfterUpdate procedure where I enter a case file number. I broke it down for ease of viewing.
DoCmd.RunSQL "INSERT INTO tabInvestigationSuspects (CaseFileNum,SuspectID, SuspectType, InvestigationNum, EntryDate)
VALUES (vCaseFileNumber, [tabCaseFileSuspects].[SuspectID], [tabCaseFileSuspects].[SuspectType], vInvestigationNumber, vDateCaseOpened)
WHERE ([tabCaseFileSuspects].[CaseFileNum] = vCaseFileNumber)"
Any assistance is appreciated. Jeff
The table tabCaseFileSuspects contains all the suspects related to a case. When I open another Investigation (many investigations to one case file) I need to insert the existing suspect(s) information into the new investigation. Because there can be different suspects applied to different investigations within the same case file, I use another table tabInvestigationSuspects.
The form that I use to enter a new investigation has the vCaseFileNumber, vInvestigationNumber and vDateCaseOpened data that needs to be inserted. What I need help with is getting the SuspectID and SuspectType from the tabCaseFileSuspects to the tabInvestigationSuspects where the case file numbers are the same. I think I’m close but when to use quotes, etc still baffles me. The following code is one line in my AfterUpdate procedure where I enter a case file number. I broke it down for ease of viewing.
DoCmd.RunSQL "INSERT INTO tabInvestigationSuspects (CaseFileNum,SuspectID, SuspectType, InvestigationNum, EntryDate)
VALUES (vCaseFileNumber, [tabCaseFileSuspects].[SuspectID], [tabCaseFileSuspects].[SuspectType], vInvestigationNumber, vDateCaseOpened)
WHERE ([tabCaseFileSuspects].[CaseFileNum] = vCaseFileNumber)"
Any assistance is appreciated. Jeff