Barcode a Custom Autonumber field

A

Asif Shah

Hello. I'm making a DB that will print a 2x1 inch label that has a field in
barcode font and regular text. The field is my autonumber, however I have
changed its format so its ... "BT"000000...So every record will be
BT000001...BT000002...BT000003. So far so good...I have already downloaded a
code39 font and it works great.

The problem is when I add a start/stop characters to the control source of
that barcoded field so it can be scanned, it ignores my format and treats it
like any other autonumber field, i.e...1....2.....3. So when I print my label
(Zebra label printer) it prints the barcode and text underneath
is...*1*....*2*.....and scans a 1....2....3...So basically the control source
is ignore the format I have put in place. below is my control source.
="*" & [table.field] & "*"

Any ideas?
 
S

Stefan Hoffmann

hi Asif,

Asif said:
Hello. I'm making a DB that will print a 2x1 inch label that has a field in
barcode font and regular text. The field is my autonumber, however I have
changed its format so its ... "BT"000000...So every record will be
BT000001...BT000002...BT000003. So far so good...I have already downloaded a
code39 font and it works great.
So you changed the format property in your table? You shouldn't do that.
Use formatting for UI elements only.

http://office.microsoft.com/en-us/access/HA012330611033.aspx

This format is only applied when viewing a table or when used with a
form or a report. It is not used when you access data otherwise.
is...*1*....*2*.....and scans a 1....2....3...So basically the control source
is ignore the format I have put in place. below is my control source.
="*" & [table.field] & "*"

Any ideas?
Use an explicit format or simply:

="*BT" & [table.field] & "*"

The best thing you can and should do: Create a standard module and
create a function like this

Public Function FormatBarcode(ANumber As Long) As String

FormatBarcode = "*BT" & ANumber & "*"

End Function

So you have a single point where you can change the format if necessary.


mfG
--> stefan <--
 
D

Duane Hookom

The format property sets what you see, not what you actually store.

Try:
="*BT" & Format([FieldName],"000000") & "*"
 

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