Results 1 to 3 of 3
  1. #1
    askjacq is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    11

    marco needed to add a certain number of records

    I have a table where they enter the number of items created. I need to create a macro (NOT vba - don't know how to use it, so please don't post answers requiring vba) that adds that number of records to a different table.

    So ... they enter
    Product - Potatoes
    Date Entered - 2/1/2013
    Product Number - 32

    They push a button and the macro adds that number of records into a d different table. Each records has the product, date entered, and an auto-generated number.

    And to make things more fun, they want all the auto-generated numbers to be even. Is that possible?

    Thank you!!

  2. #2
    askjacq is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    11
    I got more info about the auto-generated number. I don't want to use autonumber because if they add/delete records, they won't be a sequential series. So I want to generate the number based on the number of records in the table and add 1 - so if there are 1001 records, the 32 records will be number 1002, 1003 ... 1033.

    Doable?

    Oh! And they nixed the all-even idea!

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Your post has gone, unanswered, for over 24 hours, now. I suspect the problem is that very, very, very few of the experts here use Macros, with the possible exception of a specialized one call AutoExec that fires when an Access Database first opens. Macros are simply too inflexible, too difficult to debug/trouble-shoot, and make understanding what is being done difficult. If you're serious about learning how to develop Access Databases, you're really going to have to bite the bullet and learn VBA.

    The AutoIncrementing of ID-like numbers, which is what you're talking about, is pretty straightforward, but once again, is best done using VBA.

    Also, exactly how would you expect, with an AutoIncremented-number, to avoid the problem of missing numbers? If Record #15 of a series of, say, 30 Records, is deleted, that space between Records #14 and #16 is still going to be missing, regardless of how the number was generated. Using the standard DMax+1 would only help with this is the last Record entered were the one being deleted.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 1
    Last Post: 01-24-2013, 05:50 PM
  2. Marco to split up and save a report
    By jjsaw5 in forum Programming
    Replies: 1
    Last Post: 02-02-2012, 01:33 PM
  3. Replies: 15
    Last Post: 12-28-2011, 05:47 PM
  4. Replies: 6
    Last Post: 07-25-2011, 01:54 PM
  5. Replies: 0
    Last Post: 03-25-2011, 02:37 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