Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to barcoding via VB 1

Status
Not open for further replies.

ezypezy80

Programmer
Apr 1, 2003
53
0
0
NZ
I would like to print a 1 dimensional Code 39 barcode via VB thru pararell printer.

Would really appreciate any tips on syntax and etc.

many thx

 
Well code39's quite an easy one, luckily. It contains no check digits or code switches and complications of that nature. All you need is to add a * to the front and back. So if the thing you want to barcode is say a Part Number like ABC-12345-RevB, then the string you need to send is just *ABC-12345-RevB*. The *'s just alert the reader to the fact that here comes a barcode, and that it's ended.

Of course, you need to procure a font, eg from Elfring at http:\\ and set the printer to that font in order to print the code.

Visit Barcode1 for a description of this barcode methodology at Jim Brown,
Johannesburg,
South Africa.
My time is GMT+2
 
Oops, I meant to add this, too. This guy Cesar Vezga has provided code to print code39 with no font which is really great if you can't or won't buy and deploy the font allround your company. He literally draws the lines. Get it at Jim Brown,
Johannesburg,
South Africa.
My time is GMT+2
 
Thanks a lot for your reply, I now have it going on one of my clients' system.

dini
Auckland, NZ
 
I have successfuly printed a barcode without having to have a font set on the printer using Cesar's code, that is brilliant.

HOwever, now I am beginning to work on the one "with font".
I tried:

Printer.Print Space(10) *ABC-123-DEF*
ABC-123-DEF being the string I'm gonna to barcode, but VB doesnt like the *

Any thoughts?
Many thanks
 
I guess the string should be in quotes?

"*ABC-123-DEF*" Jim Brown,
Johannesburg,
South Africa.
My time is GMT+2
 
mmm I did try that...actually it reads and prints *ABC-123-DEF* instead.
 
Instead of what? I thought that was what you wanted to print? Jim Brown,
Johannesburg,
South Africa.
My time is GMT+2
 
it prints *ABC-123-DEF* instead of the barcode for this string.
 
Well you need to switch to the right font with Printer.Font.Name



Jim Brown,
Johannesburg,
South Africa.
My time is GMT+2
 
I have a bit of problem scanning my 3of9 barcode.
I paint a barcode, say Product# 998152, via VB using this sourcecode from I also tried to print same , Product# 998152, using Word with BC C39 font. They both look the same to me.

However, the scanner doesnt pick them up. I am using Symbol LS1908 scanner.
There is an example of 39 barcode from Zebra manual of #998152, showing different shape, that the scanner picks without any problem.

Will appreciate any thoughts
Many thanks
 
Did you put the *'s on the ends, ie *998152* ?

Jim Brown,
Johannesburg,
South Africa.
My time is GMT+2
 
As Jim pointed out, Code39 always needs an asterisk as the start and stop character. With the way Code39 is encoded, all Code39 barcodes start and end with the same sequence of 9 bars and spaces. Namely:
narrow bar
wide space
narrow bar
narrow space
wide bar
narrow sapce
wide bar
narrow space
narrow bar
Note 3 of the elements are wide: therefore 3 of 9, or 39.
Mike
 
I'm trying to use the code posted at but am having trouble with the reference to "pictObj" and "Printer". I am not new to vb, however I have never worked with the controls referenced in this post. Does anybody who has worked with this code before have a couple of pointers? Specifically I am trying to drop the barcode into a form based on a textbox value.

Thanks in advance,

John
 
I'm not quite sure if u r wanting to create or read a barcode. I did try that source codes, and it prints succesfully a 3of9 barcode from a textbox I have in a Form.
Anyhow, my scanner couldnt read it properly, so I tried this other tip posted by Rookie...
i.e. by downloading a barcode Font from to your Font Settings. And use it in VB as if u use a normal font such as
Printer.Fontname = such and such
Printer.Print = "*" & Text1.text & "*"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top