Results 1 to 3 of 3
  1. #1
    cres1121 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2012
    Posts
    1

    Access create an append query that can duplicate a record a number of time based a value in a table

    I would like to add to a table via form a certain number of lines. The number of lines are not always the same sometime it could be 1, 5, 30 or now I have one that is 430 lines.

    I would like to copy an existing record and them when I call this feature I would like it to ask how many records should it create. I want to then say 30 and hit enter and it will then add those records into the table 30 times.

    I want to only call upon it when I need it.

    There is one table it is affected by
    linenumber PK Autonumber
    ServiceContractnumber FK Number
    Serial Number Text
    Decommissioned Date Date
    HWSWPart FK Text
    Comment Text
    HWSW Reference FK Text

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I think you will need to use VBA and loop the number of times you want the new record to be inserted (appended).

    BTW, do not include the field "linenumber ". It is the PK and by definition unique. Being an autonumber, the value for "linenumber" will be created automatically.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    you post this to be lines 'via form' ..... and the question is how is it that a form has 1 to 430 lines? are you saying an unbound form with a single unbound text box - meaning that these are lines within a text box?

    the best approach is to have the form bound to a table....it will then allow unlimited rows (lines) ... it could be bound to your table directly - that would solve everything; But the form could be bound to a temp table for some reason - and then have an append query write it to the final table.

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

Similar Threads

  1. Replies: 3
    Last Post: 11-26-2014, 02:36 PM
  2. Replies: 4
    Last Post: 04-21-2014, 11:44 AM
  3. Replies: 16
    Last Post: 06-20-2013, 09:25 AM
  4. Replies: 1
    Last Post: 12-09-2011, 07:34 AM
  5. append query without duplicate record
    By smahdih in forum Queries
    Replies: 5
    Last Post: 11-16-2011, 12:29 AM

Tags for this Thread

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