Powerhouse123
IS-IT--Management
Hi,
I have a table which acts as a history for a child's Assessment form (done through subforms). When a new assessment is created for a child I want the history table to be populated with a couple of default records.
I've managed to work out how to use the INSERT INTO function and get the required default (prepopulated) values to appear in the history table BUT... because the history is linked by an assessment form ID in its table they are not linked and don't appear on the form...because they are not linked.
How can I pick up the newly created assessment form ID so that I can place that at the same time into my INSERT INTO statement to the history table when adding the two default records so that the assessment history default records are linked to the assesssment thus showing on the form?
Here is my INSERT INTO code which works fine but I need to enhance it to include the newly created assessment form ID number:
What I've tried to do is use the assessment ID txtbox on the form to pick up the ID number and place it into the assessment history table but this doesn't work.
DoCmd.RunSQL "INSERT INTO tblAssessmentHistory ([HistoryDescriptionID],[AssessmentID]) VALUES ('1','Forms!frmChildAssessmentDetails!frmAssessment_subform!AssessmentID');"
Any help offered would be greatly appreciated.
Apologies if this is the wrong forum.
Thanks in advance!
I have a table which acts as a history for a child's Assessment form (done through subforms). When a new assessment is created for a child I want the history table to be populated with a couple of default records.
I've managed to work out how to use the INSERT INTO function and get the required default (prepopulated) values to appear in the history table BUT... because the history is linked by an assessment form ID in its table they are not linked and don't appear on the form...because they are not linked.
How can I pick up the newly created assessment form ID so that I can place that at the same time into my INSERT INTO statement to the history table when adding the two default records so that the assessment history default records are linked to the assesssment thus showing on the form?
Here is my INSERT INTO code which works fine but I need to enhance it to include the newly created assessment form ID number:
What I've tried to do is use the assessment ID txtbox on the form to pick up the ID number and place it into the assessment history table but this doesn't work.
DoCmd.RunSQL "INSERT INTO tblAssessmentHistory ([HistoryDescriptionID],[AssessmentID]) VALUES ('1','Forms!frmChildAssessmentDetails!frmAssessment_subform!AssessmentID');"
Any help offered would be greatly appreciated.
Apologies if this is the wrong forum.
Thanks in advance!