Page 1 of 2 12 LastLast
Results 1 to 40 of 44

Thread: Bar Code Problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2006
    Posts
    2

    Bar Code Problem

    How can I generate bar code from VB 6.0 and store that code to database

  2. #2

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,692

    Re: Bar Code Problem

    Quote Originally Posted by omarfaruque
    How can I generate bar code from VB 6.0 and store that code to database
    That depends on exactly what you mean by "bar code". Do you want to store the actual picture? Or do you want to store the data the picture represents?

    If you want to store the picture, you're going to have to print it to a file or a picture control of some sort, then store that picture as a BLOB in the data base (look at post #3 in this thread for some code for that). If you want to store the data, it's just a string, so you can store it in any string type field.
    Last edited by Al42; Apr 25th, 2006 at 10:25 AM.

  4. #4
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Bar Code Problem



    hmm..

    well.. bar codes use numbers.. that part u could do (if u know the numbering structure for bar codes i have no clue there!!)

    as far as te actual Bars... u could generate the lines in a picturebox but again.. the thickness ec for each line is a mystery to me.

    Corel has a barcode wizard and corel uses VBA.. that might be an avenue to look into.
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

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

    Re: Bar Code Problem

    Static,

    There are different algorithms for different bar codes, as far as start, end and checksum characters.

    As far as generating the picture, there are bar code fonts - just print the correct characters in that font and you're printing a scannable bar code.

  6. #6
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: Bar Code Problem

    To create your own barcodes check this:
    http://www.barcode-1.com/pub/russadam/spec.html

  7. #7
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,794

    Re: Bar Code Problem

    Code 128 is the most popular bar code
    This link has helped write code that prints bar codes:
    http://www.barcodeman.com/info/c128.php3

  8. #8
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    Your easiest way is to use a barcode font. Then set a textbox or labels font property to this barcode font. Then all you have to do is set the data and it wil appear on your form ready for printing.

    VB Code:
    1. Text1.Font = "Barcode39"
    2. Text1.Text = "*Robdog888*"
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    BarCode 39 or Barcode 3 of 9 is more popular CVMichael.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,794

    Re: Bar Code Problem

    I work for a shipping company, ALL barcodes are Code 128 here....
    Barcode 3 of 9, is too big, and you can't put too much information in it.

    Barcode 3 of 9 is for amateurs

  11. #11
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    I am getting ready to start a project for Boeing Aircraft and their requirement is using BarCode 39 for their shipping labels.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  12. #12
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,794

    Re: Bar Code Problem

    Quote Originally Posted by RobDog888
    I am getting ready to start a project for Boeing Aircraft and their requirement is using BarCode 39 for their shipping labels.
    hehe

    Well, since Boeing is an aircraft company, no wonder they don't know much about shipping...
    I wonder how did they get to the conclusion that Code39 is the best barcode for their shipping ?

    Here we work with a few shipping curriers, one is them is Canada Post, wich is the largest shipping company in Canada, (the other ones I don't want to mention), but all of them (that I know) use Code128

  13. #13
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    Well I dont want to try to figure out how they came up with it but they gave me a huge pdf file on the specs for their requirements. Its like specs for a NASA project.

    Perhaps they have been using 3of9 for some years now and just want to remain constant.

    Bar codes are easy and a bit of fun too.


    In order to store the barcode to a db you would just store the code that represents the barcode like "*blah*" and then when you display it just set the font of the control that is displaying it to the barcode 3of9 or such.


    Here is a tutorial on databases - http://www.vbforums.com/showthread.php?t=337051
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  14. #14
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    CVMichael, I just came across this in the specifications manual
    Code 128 is
    recommended to be used when real–estate on the label, document, or item does not
    allow enough space for a Code 3 of 9 Bar Code.
    Most Bar Code Fonts are not free but are available for a small fee of usually less then $100 or so.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  15. #15
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,725

    Re: Bar Code Problem

    im interested in using barcode in vb. can any of you please give some example code for it?

    I have 3 textboxes, is the carriage return automatic? What if the code length are not the same?
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  16. #16
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    Check the link in post #6 and #7 for detailed information. If you purchase a barcode font then its very easy.

    I posted the code for a font type barcode in post #8
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  17. #17
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,725

    Re: Bar Code Problem

    i think you misunderstood me RobDog888. I will be buying a barcode reader (handheld). I want my apps to be able to accept code from barcode and keyboard. My question is, is there a need for special vbcode to implement barcoding in vb project?
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  18. #18
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    No, there isnt. When you hook up your scanner to the keyboard, vb will handle the barcode reading as if its being typed from the keyboard. Nothing special or fancy to do. Scan a barcode into a textbox. It will enter in as text that you can write to a db just like it was no big deal.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  19. #19
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,725

    Re: Bar Code Problem

    what if for some reason the reader is not working, can i still use the keyboard to enter a code or the keyboard is disabled?
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  20. #20
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    Usually the reader may come with an adapter cable where you can connect both your keyboard and scanner to a single ps/2 keyboard port. Its like a 'Y' adapter 2 into 1. If not then I'm sure you can find one at a computer hardware cable site.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  21. #21
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,725

    Re: Bar Code Problem

    oh i see. Thanks RobDog888. You sure gave me a point to start on! Thanks Again!!!
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  22. #22
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,725

    Re: Bar Code Problem

    Commercial Products usually uses 13 digits barcode. I have two textboxes, When i scan the code, how will i let the cursor go to the next textbox?
    There are other products out there that uses less than 13 digits. I set maxlength of the textbox=13, how will you let vb go to the next textbox if maxlength is not equal to 13?
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  23. #23
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,725

    Re: Bar Code Problem

    I manage to let the cursor jump to the next textbox if the maxlength =13 using this code:
    VB Code:
    1. If Len(txtCode) = txtCode.MaxLength Then
    2.     txtDesc.SetFocus
    3.   End If

    Now, What code is to be added so that when the scanned digits is less than 13?
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  24. #24
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    Its better to detect the start and stop characters to trigger setting the focus to another textbox. Use Instr, InstrRev, or Mid$. All of which can do the detection.

    The character is usually the asterisk "*"
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  25. #25
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,725

    Re: Bar Code Problem

    can you spare me some code please?
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  26. #26
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    Heres some c0d
    VB Code:
    1. Private Sub Text1_Change()
    2.     If Instr(1, Text1.Text, "*") = Len(Text1.Text) Then
    3.         Text2.SetFocus
    4.     End If
    5. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  27. #27
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,725

    Re: Bar Code Problem

    i changed my code with your code. The cursor does not jump to the next textbox.
    VB Code:
    1. Private Sub txtCode_Change()
    2. '------My old code-----------------------
    3. '  If Len(txtCode) = txtCode.MaxLength Then
    4. '    txtDesc.SetFocus
    5. '  End If
    6. '----------------------------------------------
    7.   If InStr(1, txtCode.Text, "*") = Len(txtCode.Text) Then
    8.     txtDesc.SetFocus
    9.   End If
    10. End Sub
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  28. #28
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    Change it to this...
    VB Code:
    1. If InStr(2, txtCode.Text, "*") = Len(txtCode.Text) Then
    When starting at position 1 it was picking up the start char instead so that position will never = the last char.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  29. #29
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,725

    Re: Bar Code Problem

    Still not working
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  30. #30
    Fanatic Member eimroda's Avatar
    Join Date
    Jul 2000
    Location
    Philippines
    Posts
    642

    Re: Bar Code Problem

    how about programming the barcode scanner and setting its SUFFIX to {TAB} or {RETURN} instead? if u use {TAB}, just set then the TabIndex of the textboxes, if {RETURN}, do it in the KeyPress event of the txtCode.
    On Error GoTo Hell

    Hell:
    Kill Me


    Food For Thought:

    - Do not judge a book... if you're not a judge!


  31. #31
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    You are using a start/stop char?

    Test to see how your scanner is setup. Add a multiline textbox to the form temporarily. When you have focus to it, scan a barcode and then another. Do they go on separate lines or any special chars o r just the numbers?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  32. #32
    Fanatic Member eimroda's Avatar
    Join Date
    Jul 2000
    Location
    Philippines
    Posts
    642

    Re: Bar Code Problem

    yes, you dont need to determine the Number of characters in a barcode if the SUFFIX is set in your barcode scanner.
    On Error GoTo Hell

    Hell:
    Kill Me


    Food For Thought:

    - Do not judge a book... if you're not a judge!


  33. #33
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,725

    Re: Bar Code Problem

    Quote Originally Posted by RobDog888
    You are using a start/stop char?

    Test to see how your scanner is setup. Add a multiline textbox to the form temporarily. When you have focus to it, scan a barcode and then another. Do they go on separate lines or any special chars o r just the numbers?
    Im a newbie when it comes to barcode. I dont even know how to program it. I did not do anything with my barcode reader, i can scan a barcode successfully but the focus will not jump to another textbox. Im not aware of start/stop char.
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  34. #34
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,725

    Re: Bar Code Problem

    [qoute]Add a multiline textbox to the form temporarily. When you have focus to it, scan a barcode and then another. Do they go on separate lines or any special chars o r just the numbers?[/qoute]

    i tried adding multiline textbox. When i scanned a barcode, number appears and the cursor is located below the number. When i scanned another barcode the number appears and the cursor is again below the number. There are no special chars at all just numbers appeared in the textbox
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  35. #35
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Re: Bar Code Problem

    I wrote this barcode program...

    My program

    It was based on code samples from around the net. I think someone had written something in Access that had helped quite a bit.

    I have seen samples on the site below for code 39 and 128..

    See this site...

    That should get you going..

  36. #36
    PowerPoster Simply Me's Avatar
    Join Date
    Aug 2003
    Posts
    2,725

    Re: Bar Code Problem

    Quote Originally Posted by birthjay
    I wrote this barcode program...

    My program

    It was based on code samples from around the net. I think someone had written something in Access that had helped quite a bit.

    I have seen samples on the site below for code 39 and 128..

    See this site...

    That should get you going..
    What i need is to let the cursor jump to the next textbox after i scan a barcode. What i am scanning right now has 13 digits. I can let the cursor jump to the next textbox if i use the code below and setting the maxlength of the textbox to 13.
    VB Code:
    1. If Len(txtCode) = txtCode.MaxLength Then
    2.     txtDesc.SetFocus
    3.   End If

    but that is not quite good enough because there are barcodes which contains less than 13 digits.
    To give is always to be NOBLE...
    To received is always to be BLESSED....
    Each day strive to be NOBLE
    Each day strive to be BLESSED

    If this post has helped you. Please take time to rate it.

    >=|+|=< Simply Me >=|+|=<

    ----------------------------------------
    Connection Strings | Number Only in Textbox | Splash Screen with Progress Bar | Printing to 1/2 of perforated bond paper |
    Freeze 2005 DataGridView Column

  37. #37
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,794

    Re: Bar Code Problem

    Just look for the new line character (ASCII 13)
    That's how I did it with the applications I made where you need to scan barcodes...

    If the scanner does not return the new line character, there is a barcode that you have to scan to the scanner, that tell the scanner to output the new line character when it's done reading.
    You can find a PDF on the manufacturer's web-site, you just have to print that PDF, and scan that barcode.

  38. #38
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: Bar Code Problem


  39. #39
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    Re: Bar Code Problem

    Heck...you can set the scanner to do that. Check your scanner documentation. Basically, after a scan you can set a tab character.

  40. #40
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: Bar Code Problem

    Your scanner is currently set to append the <ENTER> key after the scan. So like posted, just look for the chr(13) and when found, setfocus to the next textbox or change your scanner settings to the tab also like suggested. Depends on if your customers will be able to change the setting s on the scanner too.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Page 1 of 2 12 LastLast

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