Inserting Multiple Records using one form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • flashguy
    New Member
    • Jun 2007
    • 7

    Inserting Multiple Records using one form

    Hi,

    Looking online for this related topic that will be exclusively used for MS ACCESS (2000 preferably) is extremely limited.

    Is it possible to add Multiple records with one click of a buttton on a form?
  • flashguy
    New Member
    • Jun 2007
    • 7

    #2
    What i was planning of doing is have 13 questions

    ProjectID

    Questions Yes/No Comments
    1
    2
    3
    4
    5
    6
    7
    8
    And so on

    Comment

    • JKing
      Recognized Expert Top Contributor
      • Jun 2007
      • 1206

      #3
      Do the projectID and question form the primary key for the table with the fields yes/no and comment?

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        Can be achieved by the activation of an INSERT query.
        This requires a select from the table to get the needed rows like:
        Code:
        SELECT INTO tblTarget (ID, Description) SELECT ID, Description from tblSource where Q_ID = 12;
        This query can be executed from code like:
        Code:
        currentdb.execute (" <here the query string> ")
        that's triggered from a click on a button.

        Getting the idea ?

        Nic;o)

        Comment

        • flashguy
          New Member
          • Jun 2007
          • 7

          #5
          Originally posted by nico5038
          Can be achieved by the activation of an INSERT query.
          This requires a select from the table to get the needed rows like:
          Code:
          SELECT INTO tblTarget (ID, Description) SELECT ID, Description from tblSource where Q_ID = 12;
          This query can be executed from code like:
          Code:
          currentdb.execute (" <here the query string> ")
          that's triggered from a click on a button.

          Getting the idea ?

          Nic;o)
          I have a one to many table relationship. Example: projectID to many questions.
          Currently, the form is paging/displaying one question at a time.
          Is it possible ALL questions at once. And is it possible to SAVE the questions at once

          Comment

          • nico5038
            Recognized Expert Specialist
            • Nov 2006
            • 3080

            #6
            Just remove the WHERE from the SELECT in the INSERT statement to get the entire table.

            Nic;o)

            Comment

            • flashguy
              New Member
              • Jun 2007
              • 7

              #7
              Last question

              Appending the query works :) however, In the form, i wanted to contain multiple textboxes that submits to the same field. However, when i start adding info to the text box, all other bounded textboxes for the same field will be mirrored.

              Is there any way around this?

              Comment

              • nico5038
                Recognized Expert Specialist
                • Nov 2006
                • 3080

                #8
                Sorry, but binding multiple textboxes to the same tablefield won't work.
                You'll have to use multiple rows (e.g. by adding a rownumber as additional key) when multiple entries are allowed or use multiple fields. The latter is however against normalisation rules and not advised.

                Nic;o)

                Comment

                Working...