append current record to a temp table

Posted on 2007-10-19
Last Modified: 2013-11-28
I am creating a shipping label program in access 2002 which uses 3 linked read only tables from a sql 2000 server. In this database I have created 2 tables "tblLabels" and "tblLabelsTemp". The form I am using is for the most part complete and uses the tblLabels table. I have two combo boxes one for job number and one for shipto line item which auto fills certain fields from the 3 tables after update. I need to, after entry of the shipping record, create labels that are used on the cartons that will be shipped out based on the information taken from the 3 linked tables that are being saved the the tblLabels table. The problem is for each record I could, base on the amount of pieces in each carton, have to print multiple labels with a "1 of 2" or "2 of 2" scenario based on a field called total labels. I would like to know and be shown what would the easiest way to do this, should I populate the temp table with a count field and duplicate the records. Thanks in advance for your help!


Question by:kdart301
    1 Comment
    LVL 2

    Accepted Solution

    The solution you suggest is pretty much what I'd do;

    Create a temp table and build your labels report based on it
    Populate at run time the temp table
    Run the report to generate the 1 of 2, 2 of 2 labels

    private sub createlabels(p_1stLine as string,p_2ndLine as string,p_iNumLabels as integer)
    dim oRst as dao.recordset
    dim gSQL as string
    gSQL = "Select * from temptable"
    set orst = currentdb.openrecordset(gSQL)
    with orst
    if not .eof and .bof then
    do while not .eof
    for i = 1 to num_of_labels
    !1stLine =p_1stLine
    !2ndLine =p_2ndLine
    !iLabel = i
    !iNumLabels = p_iNumLabels
    docmd.openreport YourReport,acnormal
    end with
    set oRst = nothing

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now