[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 857
  • Last Modified:

append current record to a temp table

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!


1 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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now