Daryl S replied to Dennis
16-Feb-10 11:04 AM

Dennis -
I would suggest creating the batch number first, then updating the table
with the batch number, and using the batch number to select which records to
print. If you use Autonumber for the batch number, then you have no fear of
there being a duplicate batch number. If the print fails, you can just
re-run the same query (no new records will be added). You could even add a
field to the Batch Number table to indicate who ran it (machine name or logon
name, etc.).
As for your questions:
1. You can have both a print preview button and a print button on the form,
but I do not think that will help, as the user can print from print preview
mode, and depending on the printer dialog box, they can choose print preview
even after hitting the print button. Someone else may know more than me on
that one.
2. Use an append query. If all the information you need (other than the
batch number) is on the form, then you can run it from there. Then you will
need a select query (using the same form controls as criteria) to get the
batch number that was assigned (assuming autonumber). Put this batch number
on the form (it can be invisible if you do not want the users to see it).
3. When the user pushes your Print button - I would first check to see if
you have already have a batch number (see #2). If so, use that to re-print
the report. If not, then run the append query from #2, and your update query
to put the batch numbers on the records. Then run the report. I am not sure
if you want a confirmation then, or if you want to ask the user before
leaving the form or pulling new records if they received the printout. If
the user did not actually print the report, you would only remove the batch
number from the records - do not remove the batch number from the batch table.
4. If you set up the batch number first as described above, this will not
be a problem.
--
Daryl S