Printing multiple labels with the same info

C

Chris A

Hi, all,

My end-user needs a simple database that would allow the user to specify how
many labels he/she want to print (avery labels) with the data they just
entered. If the user needs 5 labels with the exact same data, they want to
be able to enter the number "5" in a text box named "txtLabelQty". Access
would then generate a report with 5 identical labels. They'd then put the
blank label sheet in their printer and away they'd go.

I first built my main tables that would store the data. I then thought I
should build a "holding area" table with no primary key but with fields named
identically to the main table.

I would then use an append query to tell Access, "take the record on the
current form (with RecordSource being the main table) and put it in the
'holding area' table; do this as many times as is the value of 'txtLabelQty'."

I'm sure this requires code, but this is where I'm stuck.
Help?

Thanks!
 
J

John Vinson

Hi, all,

My end-user needs a simple database that would allow the user to specify how
many labels he/she want to print (avery labels) with the data they just
entered. If the user needs 5 labels with the exact same data, they want to
be able to enter the number "5" in a text box named "txtLabelQty". Access
would then generate a report with 5 identical labels. They'd then put the
blank label sheet in their printer and away they'd go.

I first built my main tables that would store the data. I then thought I
should build a "holding area" table with no primary key but with fields named
identically to the main table.

Storing your data redundantly in a second table is neither necessary
nor beneficial. Access can print from a Query perfectly well - there
is no need to create a new table just to generate a report!
I would then use an append query to tell Access, "take the record on the
current form (with RecordSource being the main table) and put it in the
'holding area' table; do this as many times as is the value of 'txtLabelQty'."

No code is required. What you can do is create a little auxiliary
table, let's call it Num, with only one Number field, N. Manually fill
this table with values from 1 through the most labels you'll ever need
(be generous!)

Create a Query by taking your main table and Num, with NO join line.
This will give you a "Cartesian Join" query, with 100 copies of each
of your lables if N goes up to 100. Put a criterion on N of

<= [Forms]![YourFormName]![txtLabelQty]

and it will restrict it to 5 copies of each label (if the user typed 5
into that textbox). Base the label report on this query.

John W. Vinson[MVP]
 
C

Chris A

Hi, John,

Thanks! I knew it didn't have to be as complicated as I was making it out
to be.

John Vinson said:
Hi, all,

My end-user needs a simple database that would allow the user to specify how
many labels he/she want to print (avery labels) with the data they just
entered. If the user needs 5 labels with the exact same data, they want to
be able to enter the number "5" in a text box named "txtLabelQty". Access
would then generate a report with 5 identical labels. They'd then put the
blank label sheet in their printer and away they'd go.

I first built my main tables that would store the data. I then thought I
should build a "holding area" table with no primary key but with fields named
identically to the main table.

Storing your data redundantly in a second table is neither necessary
nor beneficial. Access can print from a Query perfectly well - there
is no need to create a new table just to generate a report!
I would then use an append query to tell Access, "take the record on the
current form (with RecordSource being the main table) and put it in the
'holding area' table; do this as many times as is the value of 'txtLabelQty'."

No code is required. What you can do is create a little auxiliary
table, let's call it Num, with only one Number field, N. Manually fill
this table with values from 1 through the most labels you'll ever need
(be generous!)

Create a Query by taking your main table and Num, with NO join line.
This will give you a "Cartesian Join" query, with 100 copies of each
of your lables if N goes up to 100. Put a criterion on N of

<= [Forms]![YourFormName]![txtLabelQty]

and it will restrict it to 5 copies of each label (if the user typed 5
into that textbox). Base the label report on this query.

John W. Vinson[MVP]
 
Top