Results 1 to 4 of 4
  1. #1
    thestappa is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2008
    Posts
    16

    Duplicate a row

    Hello all,



    I'm looking for the easiest way to duplicate a row in a table. I have some tables for a budgeting program that have rows separated by HOURS and DOLLARS (TYPE). Pretty basic. However, some of the rows (by design) don't have data in the TYPE field.

    What am need to do with those rows is duplicate the row in the table, then give one of the rows TYPE HOURS and the other TYPE DOLLARS.

    I'm not sure how to accomplish this in Access. In my mind I would do something like below.

    1) Loop through records with TYPE null
    2) For each record copy entire recordset into table with DOLLARS in the type field
    3) Update the remaining records with TYPE null to have TYPE HOURS.

    I'm not sure how to pull off step 2 easily.

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    I dont understand why you need to duplicate. why not have HOURS and DOLLARS as fields and just indicate via yes/no or however you want. One record is all that is needed. Am I misunderstanding?

  3. #3
    thestappa is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2008
    Posts
    16
    Quote Originally Posted by TheShabz View Post
    I dont understand why you need to duplicate. why not have HOURS and DOLLARS as fields and just indicate via yes/no or however you want. One record is all that is needed. Am I misunderstanding?

    I don't have it that way because I need one row for HOURS and one row for DOLLARS. There will also be UNITS but that isn't an issue, yet...

    It's a good question, but in this application I have legitimate reasons why I need to have what are basically duplicate rows.

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Well, if your table has only 1 instance per record, you can create a second table that holds all the values you want for TYPE and then run a query with it without using a join. You'll create a Cartesian product and have 1 instance of each record each with 1 of the TYPEs.

    ...finally a positive outcome of a Cartesian product.

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

Similar Threads

  1. duplicate autonumber
    By rayc in forum Access
    Replies: 5
    Last Post: 06-19-2013, 07:50 AM
  2. Duplicate Records
    By softspoken in forum Queries
    Replies: 3
    Last Post: 06-21-2010, 03:33 PM
  3. Duplicate first row
    By kruai in forum Access
    Replies: 1
    Last Post: 06-22-2009, 02:06 PM
  4. Duplicate add to new table
    By horseyshoe in forum Access
    Replies: 3
    Last Post: 09-01-2006, 07:51 AM
  5. Which duplicate?
    By grgerhard in forum Import/Export Data
    Replies: 1
    Last Post: 05-27-2006, 06:19 AM

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