Results 1 to 19 of 19

Thread: Bar Code

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2002
    Posts
    83

    Cool Bar Code

    HELLO FRIENDS

    I M COMPLETELY NEW WITH THIS BARCODE THING.
    NEED TO KNOW HOW CAN I GENERATE THE BARCODE AND ALSO HOW CAN I THEN SAVE IT IN A DATABASE.

    SHOULD I SAVE IT LIKE A PIC. AND THEN

    ALSO I NEED TO TAKE THE PRINT OF THE GENERATED BARCODES ...SO THAT I CAN LABLE IT 2.......


    REALY HV NO IDEA ...

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Bar Code

    From what I have seen in the many threads about it, all you need for barcodes is a font - which you can print or show on screen.

    This means that the what you save to the database is simply the text of the barcode.


    To find out what font(s) to use (and where to get them), search for the previous barcode threads, as several of them contain good advice.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2002
    Posts
    83

    Re: Bar Code

    i hv downloaded the fonts 3of9 but dont know further wat to do with it . in the next step...
    also how can i print the lables.....

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Bar Code

    First of all you need to install the font - you can do that in the Fonts section of Control Panel.

    To print labels with it, you use normal printing code (just change the font to yours), eg:
    vb Code:
    1. Printer.FontName = "3of9"
    2. Printer.FontSize = 12
    3. Printer.Print "01231212"  'your barcode value
    4. Printer.EndDoc
    To draw it on screen, you can simply use normal controls (label/textbox/...) with the font changed as apt.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2002
    Posts
    83

    Re: Bar Code

    Thanks for your help


    Really need one more favor..

    i.e i wan to print the lable as

    barcode lines ||||||||||||||||
    Barcode # Cat ID + ITemID
    Amount 500


    one more thing the # of time to print on the paper row wise

    i mean to ask dynamicaly changes the # of colums in a row ...
    from 5 to 5 or 5 to 4..



    barcode font

    3 of 9

    Barcode font dowloaded from http://www.squaregear.net/fonts/free3of9.shtml

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Bar Code

    I don't understand what you mean I'm afraid, can you explain in more detail?

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Nov 2002
    Posts
    83

    Re: Bar Code

    i have downloaded the fonts 3of9 and installed them. i hav printed them . they work fine.now i want to print the lables as i hve explained
    i.e


    name of the item

    '--------------
    barcode |||||||||||||||
    db value 50-50

    then the price 500.
    '---------------------------
    this all will be printed as a single lable.

    where 50-50 is the item id from database. such as (catID + itemid) a mix combination.

    then printing options are .

    user wants to print the 5 lables in one row of a single paper. or 4 lables in one row.. (same lables) to hv some space adjustments on a A4 Paper size.

    i hope u got the point...



    one more thing
    wat should should i hav to cater when designing the db coz its my first attempt of Barcode. so really confused.


    until now i hv installed the fonts. use the script to print the lables.

    now printing the lables as the customer wants explained above. is one thing i had to do.



  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Bar Code

    To print out other data simply change the font, and use .Print again. For other things you can do (such as lines) see the printing tutorial in our Classic VB FAQ's.

    To do multiple labels, simply place the code in a loop - except the .EndDoc line, as that marks the end of the document.

    For the database, simply store the barcode value as a varchar/text data type.

  9. #9
    New Member
    Join Date
    Apr 2007
    Posts
    4

    Re: Bar Code

    Hi, since we're in the subject of barcodes...does anyone knows how to increase the height of the barcode? instead of adding the barcode fontsize?
    as in...remain fontsize 12 but would want it to be slightly taller or shorter?

    I can replicate this in DOS / ASCII mode through LPT1...but through VB all i get is increasing FONTSIZE and im running out of SPACE on output...

  10. #10
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Bar Code

    to increase or decrease you can adjust the height of the label and the font size...increase the font size and decrease the height of the label...
    Otherwise you need to get third party barcode controls like Mabry control, using which you can do whatever you want to do, its paid control
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  11. #11
    New Member
    Join Date
    Apr 2007
    Posts
    4

    Re: Bar Code

    Thanks for the reply! ^.^v ok here's the thing. What do you mean the height of the label? im running this printout through a SATO CT400 label printer and the current code im using is as below :-

    Printer.CurrentX = 2900
    Printer.CurrentY = 120
    Printer.FontSize = 20
    Printer.FontBold = False
    Printer.FontName = "Free 3 of 9 Extended"
    Printer.Print "*" & var1 & "*"

    A very straight forward change font size for height for barcode. Any links you know of? I'd want to replicate these into an output and not on the form.

  12. #12
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Bar Code

    Quote Originally Posted by linkin182
    I'd want to replicate these into an output and not on the form.
    Im sorry, I thought you want to increase the font height in the form...you need to try some 3rd party tools only...
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  13. #13
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Bar Code

    Have you thought of simply printing the barcode twice?

    Obviously there would be a space between the two barcodes - but with careful adjustment of the .CURRENTY you can remove that space.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  14. #14
    New Member
    Join Date
    Apr 2007
    Posts
    4

    Re: Bar Code

    I'd give that a thought...thanks alot...

  15. #15
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Bar Code

    Quote Originally Posted by linkin182
    I'd want to replicate these into an output and not on the form.
    Output into what? A database? The printer?

    If you want to print multiple labels, just reset your X and Y and print. It'll take a little experimentation to get all the labels lined up exactly.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  16. #16
    New Member
    Join Date
    Apr 2007
    Posts
    11

    Re: Bar Code [URGENT]

    Hi i am new to vb.net as most people are on this forum. I have been looking thru some threads that mentions abt barcoding and stuff. First of all i am trying to create a Point of Sale system for a clothing shop which does not have a manufacturer barcodes on the item, so i guess i will have to make my own barcodes and print them out. So far i have not done any programming on this, bt i have, however, downloaded and installed the "3of9" fonts. So where do i go from here? Do i need to have a field call "barcode" on my inventory table in my database and make up some numbers on it? and also if i buy a barcode scanner from the shop do i still need to write some code to interface it with my program?

    Hope someone can provide me some codes or link me to some thread to start me off in this.

    Thanks

    Jon

    Programs im using for this:
    VB.net Express Edition
    MS Access 2003

  17. #17
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Bar Code

    1) Use UPC codes. There's an industry standard - if the UPC code starts with "2", it's not a real UPC code, so you can use it, even externally, and it won't cause problems. You will have to create valid codes or the scanner won't read them.

    2) Yes, if you want to keep the barcode, you'll need a barcode field. Just make a plain char-type field.

    3) How you interface the scanner depends on the scanner. Most of them look, in software, like keyboards, so you just wait for keypresses - there's one for each character and a vbCr at the end. Trap the vbCr (If KeyAscii = vbCr Then) in your KeyPress sub for the control that's getting the barcode (a text box?) and you'll know when a barcode has been entered (or someone hit the Enter key).
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  18. #18
    New Member
    Join Date
    Apr 2007
    Posts
    4

    Re: Bar Code

    @ Al42 : Output as in via printer. Can be on any form, whether its on paper or labels.

    @ tquereshi22 : Dude, you can try my code above if you want to print it out. just make sure you end your print session with "Printer.enddoc"

    Btw, tried printing twice and it made my barcode taller..:P thanks guyz.

  19. #19
    New Member
    Join Date
    Apr 2007
    Posts
    11

    Re: Bar Code

    Hi guys i used the IDAutomation componets for creating and printing barcodes. I am stuck on how to bind data to the barcode as it does not provide any tutorial on the IDAutomation website. The data i want to bind is itemid, price and item name, which is the field on my database table "tblitem". And also after the data is binded how do i scan the barcode and make the bind data to appear on the listview box.

    This is urgent so please if any of you have any codes which can help to start me off, then please do.

    Thanks

    Jon

    software used for project:
    VB 2005/VB.NET
    MS ACCESS 2003

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width