Generate list of barcodes (1 Viewer)


Registered User.
Local time
Yesterday, 20:07
Oct 29, 2017
Hi Access Superheros!

I am looking to pick your brains again. I am looking for the code (sample) to create a report of barcodes where the user is prompted for the beginning and ending barcode number incremented by 1 when code is executed. It would look something like the following:

Form opened
Popup box prompting the user for the beginning and ending barcode numbers.

As always, any help will be appreciated.

The code should look something like this:

Private Sub btngenerate_Click()

Dim x As Integer
Dim barcode As String

x = Me.txtstartingnumber.Value
currentyear = Year()

Loop Until x = Me.txtending_number.Value

' create a matrix to store barcodes

x = x + 1

barcodestring = "*" & currentyear & Me.txtstartingnumber.Value & x & Me.txtstudentname & Me.txtstudentgrade & Me.txtendingnumber.Value & "*"

'once matrix is full of requested barcode number run report


'report should be a 4 up style i.e.

' 2021000001     2021000002 2021000003 2021000004
' barcods will be used to create student library card

End sub

End Sub


I’m here to help
Staff member
Local time
Yesterday, 17:07
Oct 29, 2018
You can do this without using code. Instead, look into using a Tally table and a Cartesian query.

Users who are viewing this thread

Top Bottom