sequential numbering a label in access not based on a table

By skreisher ·
I am trying to create carton labels in access the label must have carton # 1 of 192, 2 of 192 etc... so i need to have sequential numbering on the labels. Is there anyway to do this without creating 192 records in a table?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -


by jck In reply to sequential numbering a la ...

If you are not tying the label number to a container number, sure you can.

Simply make a table with 3 columns:

ID (What you want to call the counter)

Make the Current value default start value to 1.

This will create a table for you that always starts current_value with a one.

After that, you write your access to get the recordset. Whenever you successfully print and increment a counter variable representing a label number, increment the current value variable and database column value until incrementing it would make it go over the max value column. This will not only let you keep the last label number you printed (in case of program/hardware failure), but it will also let you only have one entry in one table that maintains counts for a specific purpose/module/code class.

If you didn't want to do this in a database table, you could just use a recordset/table in memory and then when done deallocate it.

Related Discussions

Related Forums