Hello.
I am struggling a little bit with using a checkbox to generate multiple values in the same table.
Essentially I have a projects table, that is linked to a sample table by ProjectID. The sample table is essentially the follow fields:
SampleID, ProjectID, Sample Description, Sample Recieved, Sample Entered, ParentSample Attachments.
Basically normally we enter samples with all of the information, but leave the ParentSample field empty. When the sample is based on another sample, or is created as a result of recieving another sample the parent sample gets filled in with the initial ID of the sample recieved, and then the rest of the details get filled out.
What i want to do, is have checkboxes bound to the sampleID of each sample, so the user checks the boxes for samples they want to generate subsamples from, and when they hit a button, up pops a form that asks the testing period, and the tubes required (x hours, or 24 hours, 7 days and so on) and what tubes (Carbon, XAD-2, Silica and so on).
How can i get it so that it loops through the selected samples and creates subsamples in the following format?
SampleID, ProjectID, Sample Description, Sample Recieved, Sample Entered, ParentSample Attachments.
NEWID, FORM1.ID.value, (Tubetype,collection period, parentsample), date, date, initialsample, no attachements
and also create a new sample for every tube clicked. So for example if 3 x Carbon and 1 x XAD-2 were ticked for 7 days, for samples 72343. 72435
A total of eight new subsamples would be generated, four of which would reference 72343, four of which would reference 72435 in the parent field.
I am struggling a little bit with using a checkbox to generate multiple values in the same table.
Essentially I have a projects table, that is linked to a sample table by ProjectID. The sample table is essentially the follow fields:
SampleID, ProjectID, Sample Description, Sample Recieved, Sample Entered, ParentSample Attachments.
Basically normally we enter samples with all of the information, but leave the ParentSample field empty. When the sample is based on another sample, or is created as a result of recieving another sample the parent sample gets filled in with the initial ID of the sample recieved, and then the rest of the details get filled out.
What i want to do, is have checkboxes bound to the sampleID of each sample, so the user checks the boxes for samples they want to generate subsamples from, and when they hit a button, up pops a form that asks the testing period, and the tubes required (x hours, or 24 hours, 7 days and so on) and what tubes (Carbon, XAD-2, Silica and so on).
How can i get it so that it loops through the selected samples and creates subsamples in the following format?
SampleID, ProjectID, Sample Description, Sample Recieved, Sample Entered, ParentSample Attachments.
NEWID, FORM1.ID.value, (Tubetype,collection period, parentsample), date, date, initialsample, no attachements
and also create a new sample for every tube clicked. So for example if 3 x Carbon and 1 x XAD-2 were ticked for 7 days, for samples 72343. 72435
A total of eight new subsamples would be generated, four of which would reference 72343, four of which would reference 72435 in the parent field.