Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2014
    Posts
    5

    Unanswered: insert into, select multiple records

    Hi

    I have a main form that has four subforms.
    These subforms are filtered based on the selection on main form. (via four comboboxes)
    User selects a record in each of these subforms and I want to save each users selections in another table.

    The below query inserts a record based on users selection in the first subform only. How do I use UNION ALL to get this to check all subform selections?

    INSERT INTO dbo_TjnStudentClassProgram ( StudentID, ClassID, PSID, ProgramID )
    SELECT [Forms]![FrmStudentInformation]![StudentID] AS StudentID,
    [Forms]![FrmSelectClasses]![Combo0] AS ClassID,
    [Forms]![FrmSelectClasses]![FrmSelectClasses Subform1].[Form]![PSID] AS PSID,
    [Forms]![FrmSelectClasses]![FrmSelectClasses Subform1].[Form]![ProgramID] AS ProgramID;

  2. #2
    Join Date
    Oct 2014
    Posts
    5

    insert multiple subform selections

    Hi
    I have a main form that has four subforms.
    These subforms are filtered based on the selection on main form. (via four comboboxes)
    User selects a record in each of these subforms and I want to save each users selections in another table.
    The below query inserts a record based on users selection in the first subform only. How do I use UNION ALL to get this to check all subform selections?

    INSERT INTO dbo_TjnStudentClassProgram ( StudentID, ClassID, PSID, ProgramID )
    SELECT [Forms]![FrmStudentInformation]![StudentID] AS StudentID,
    [Forms]![FrmSelectClasses]![Combo0] AS ClassID,
    [Forms]![FrmSelectClasses]![FrmSelectClasses Subform1].[Form]![PSID] AS PSID,
    [Forms]![FrmSelectClasses]![FrmSelectClasses Subform1].[Form]![ProgramID] AS ProgramID;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •