Question Locked

sequential numbering a label in access not based on a table

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
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?

2 replies

by jck

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)
Current_Value
Max_Value

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 [b]and[/b] 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.

This discussion is closed to new replies.