I have a multiple value form: sbfrmTests_multi
*Please ignore sbfrm - at present that is the name, but it has no parent.
- Form use: select tests and insert them into a template with the same templateID.
I have a static table: tblTests
-A table of tests, to populate the selection options (Checkboxes) on sbfrmTests_multi
I have a data entry table: TestRecord
-A table to hold the templateID and the tests selected from sbfrmTests_multi
When you select the available options, the form returns with the tests selected:
The form's data source is a Select Totals query (to prevent duplicate records):
Expand|Select|Wrap|Line Numbers
- SELECT DISTINCTROW Testing.testid, Testing.TestCategory, Testing.Test, Max(Testing.TestMethod) AS MaxOfTestMethod, Max(Testing.NPN) AS MaxOfNPN, Max(Testing.Cosmetic) AS MaxOfCosmetic, Max(TestRecord.TemplateID) AS MaxOfTemplateID, Max(TestRecord.TestRecordID) AS MaxOfTestRecordID
- FROM Testing, CoATemplate, TestRecord
- GROUP BY Testing.testid, Testing.TestCategory, Testing.Test
- HAVING (((Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_hm] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_hma] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_mb] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_mb2] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_pe] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_rs] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_pc] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_me] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_bo] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_ad1] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_ad2] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_wa] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_cu1] Or (Testing.TestCategory)=[forms]![sbfrmTests_multi]![t_cu2]))
- ORDER BY Testing.TestCategory, Testing.Test;
I added two unbound textboxes to the form: (TemplateID_1) that will eventually auto-populate from a parent form (header), (TemplateID_2) in the data field entry of the multiple items form.
TemplateID_2 updates to = TemplateID_1 (working as desired).
What I need is a command button to insert all visible records from the multi-select form into another table.
So if I select test a, b and c, the multiple items form shows test a,b, and c - and templateID updates to be the same for all the results that display.
I need help inserted all displayed records on the form into table: TestRecord.
I can only get the first row to insert with a command button right now.
I'm sorry for the convoluted questions and truly appreciate any help! :) <3