Results 1 to 2 of 2
  1. #1
    Hendro623 is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2016
    Posts
    14

    Creating multiple New records of releated data from one single Entry

    I'm looking to create a database that would generate labels to be scanned and used to track our inventory. Each label needs a unique ID that cant be duplicated. I imagine a form where a user would enter their Item, Lot, quantity, etc. followed by how many labels needed. The number of labels would be the number of records that are created and all contain the same data, minus unique ID that would be scanned. It seems like this is possible but I have no idea where to start.
    I've built a similar concept in excel where I auto filled some fields based on entries, then used the =NOW() formula down to the second but in number format, which was entered into a template as the ID. I then made a similar template in the same worksheet, but changed only the formula to add another second from the 1st ID(date), making it unique. I then copied that one over 100 times where each unique ID always reflected the previous... if that makes sense. Each template is sized as 1 page, only thing is that the user has to specify how many pages otherwise it prints the entire workbook. Its usable, but I'd like the ability to do something like that in access. Anyone have an idea on how to throw something like that together?

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    something like the following in a 'create labels' button click event

    Code:
    dim I as integer
    dim lastID as integer
    lastID=dmax("LabelID","tblLabels")
    for I=1 to me.labelsneeded
        currentdb.execute("INSERT INTO tblLabels (Item, Lot, quantity, LabelID) Values(" & me.item & ", " & me.lot & ", " & me.quantity & ", " & LastID+I & ")")
    next I
    Alternatively for LabelID, make it an autonumber field, in which case you don't need to insert it

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

Similar Threads

  1. Replies: 1
    Last Post: 06-24-2016, 02:34 PM
  2. Data Entry to Multiple Records
    By Brian_S in forum Access
    Replies: 2
    Last Post: 01-21-2016, 11:53 AM
  3. Replies: 5
    Last Post: 03-06-2015, 02:04 PM
  4. Creating multiple records from a single form
    By secretary in forum Forms
    Replies: 8
    Last Post: 07-18-2011, 04:03 PM
  5. Replies: 0
    Last Post: 07-26-2010, 07:34 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