Results 1 to 3 of 3
  1. #1
    EvanRosenlieb is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Location
    Fort Collins, CO
    Posts
    37

    Is it possinle to copy and paste into multiple new records?

    Hello all,

    I am entering data that is the output of a machine that measures concentrations of different gasses in the air. The data is output by the machine into an tab delimited text file that I use Excel to open and Access. Each run the machine does had data that needs to go into three different tables in the database, one parent and two children of that parent table. Making a form is to support this is not too difficult, as I just need to make a form that has two sub forms, and this allows me to enter data into all three tables at once, whereas doing them all separately is obviously quite a mess.



    However, the problem with this sort of method is that each Excel file has over twenty records to enter into each child form. In order to copy and paste the relevant records from Excel into Access, I need to first create the records in the Access table, by pressing space in the first field and then pressing the down arrow twenty-some times. Then, there are twenty-some blank records into which I can copy and paste all the data from the Excel file. I am going to have to do this hundreds of times, and having to create the records by pressing the space bar seems a bit silly and time-prohibitive.

    Importing and appending the files directly from Excel skirt this problem, but I do not know how I could do this for three tables at a time like the form allows me to do.

    So, can anyone think of a way to solve this problem?

    Thanks,

    --Evan

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    I would probably write a procedure to import the records. I don't know the structure of the text file, but likely I'd use a recordset to add the parent record. That would let me get the key field value (which I assume isn't in the text file), which cn then be used to append the child records.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    You may be able to do this with forms at all, but first a couple of questions about the format oaf the tab-delimited file.

    - Does each line in the tab-delimited file contain about the parent as well as one of the child records? In other words, is the data about the parent repeated (and identical) for each measurement? In the scenario I am thinking of, this is a good thing.

    - Does each set of data in the file contain a unique (for that data set) identifier, such as a run number? Again a good thing.

    So for example two sets of three might look like this:

    1 A11 A12 A13 B11 B12 B13
    1 A11 A12 A13 B21 B22 B23
    1 A11 A12 A13 B31 B32 B33
    2 A21 A22 A23 B41 B42 B43
    2 A21 A22 A23 B51 B52 B53
    2 A21 A22 A23 B61 B62 B63

    If you have a setup like this, the solution might be fairly easy.

    John

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Copy paste multiple rows in a table
    By Biologybook in forum Access
    Replies: 9
    Last Post: 04-07-2014, 02:08 PM
  2. COPY records from SUBFORM and PASTE to EXCEL?
    By taimysho0 in forum Programming
    Replies: 9
    Last Post: 11-28-2011, 02:45 PM
  3. Copy-Paste
    By BorisGomel in forum Access
    Replies: 4
    Last Post: 10-25-2011, 07:17 AM
  4. Paste into multiple records
    By PIHA520 in forum Access
    Replies: 1
    Last Post: 05-29-2011, 06:33 PM
  5. Replies: 5
    Last Post: 12-10-2009, 10:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums