print a name tag from form used to check in students

K

kwright11

We use a form to check students in to their classes, and want to print name
tags with the current date for the student and their parent or guardian so
only the correct person(s) picks up the child.
How can I set up the form, or connected report, to print only the current
student being checked in to a nametag? I need at least two copies printed of
each student checked in.
I am using Office 2007.
 
K

Ken Sheridan

You can use the label report wizard to create tags of a suitable size.

To enable you to select how many to print create a new table called Numbers
with a single column Number of (you guessed it!) number data type. Enter
numbers from 1 to whatever the maximum number of labels you might want to
print is. It doesn't matter how high you go so long as you go at least high
enough.

Base the label report on a query which includes your Students table and the
Numbers table, but don't explicitly join the tables. This creates what's
known as the 'Cartesian product' of the two tables, i.e. every row in one is
joined to every row in the other (mathematically Cartesian coordinates are a
set of coordinates describing the position of a point in relation to a set of
intersecting straight axes).

In query design view include the necessary columns from Students and the
Number column from Numbers in the query. Be sure to include the primary key
column of Students, e.g. StudentID. Uncheck the 'show' checkbox for the
Number column and in its 'criteria row' put:

<=[Enter number to print]

In a the 'field' row of a blank column put:

CurrentDate: Date()

The query in SQL view will look something like this:

SELECT StudentID, FirstName, LastName,
DATE() AS CurrentDate
FROM Students, Numbers
WHERE Number <= [Enter number to print];

Back in your form add a button to print the label report, with code like the
following in its Click event procedure:

Const ConREPORT = "YourLableReportName"
Dim strCriteria As String

strCriteria = "StudentID = " & Me.StudentID

DoCmd.OpenReport conREPORT, WhereCondition:=strCriteria

When you click the button you'll be prompted for the number to print, and
then the report will print that number of labels.

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top