Hi,

I'm not quite sure which forum I should post my question, so if this seems like the wrong place for it feel free to move it to the appropriate forum.

Right now when I use a barcode scanner it will scan the barcode information into one field. However I want to be able to scan ONE barcode and have within that barcode the information for multiple fields and have that scan enter the information for all the fields.

So instead of doing individual barcodes for each field, I would have one barcode that would cover all the fields. Any information on this would be very helpful.

Thank you,

Stephen K.

Hi,

I'm not quite sure which forum I should post my question, so if this seems like the wrong place for it feel free to move it to the appropriate forum.

Right now when I use a barcode scanner it will scan the barcode information into one field. However I want to be able to scan ONE barcode and have within that barcode the information for multiple fields and have that scan enter the information for all the fields.

So instead of doing individual barcodes for each field, I would have one barcode that would cover all the fields. Any information on this would be very helpful.

Thank you,

Stephen K.

We're doing exactly this at the moment in my day job. I've just written a little VB program to parse out the separate fields from the barcode.

We have fixed length fields in our barcode so parsing them out is trivial, but if you have variable length fields you could always use a delimiter.

So in our case our barcode is CODE128 and is 10 digits long, the first two are a product group, the next four a batch number, and the last four sequence number.

In VB or VBA parsing these out is trivial:

dim intProductGroup as integer,intBatch as integer,intSequence as integer

  intProductGroup=CInt(Left(strBarCode,2))
  intBatch=CInt(Mid(strBarCode,3,4))
  intSequence=CInt(Right(strBarcode,4))

Hope that helps somewhat.

mnemtsas- Thanks a lot for the help.
Could you explain the specifics a bit more? I apologize, but my knowledge in the programming world is slim.

First: is Visual Basic a program any Windows Computer should have? or would I have to purchase or download it from somewhere?

Second: Within Visual Basic do I make the barcode, or do I insert the VB code into a different program, such as Word, when I make the barcode.

Third: I will need a Delimiter, how would that work within the code.

Again, Thanks for the help
Stephen K.

mnemtsas- Thanks a lot for the help.
Could you explain the specifics a bit more? I apologize, but my knowledge in the programming world is slim.

First: is Visual Basic a program any Windows Computer should have? or would I have to purchase or download it from somewhere?

Second: Within Visual Basic do I make the barcode, or do I insert the VB code into a different program, such as Word, when I make the barcode.

Third: I will need a Delimiter, how would that work within the code.

Again, Thanks for the help
Stephen K.

If you have MS Office then you have Visual Basic for Applications. Most barcode scanners will come with cables to allow you to put them inline with the computer keyboard. The computer then considers the barcode input to just be keyboard input. You can write a smart Excel worksheet specifically for the purpose of grabbing the barcodes and splitting them up.

As to the delimiter use the "Instr" function. I don't have my software here but off the top of my head here's some code that will pull out and print all the fields from a barcode using the underscore _ as a delimiter

intPosition=1
   Do
     if instr(intposition,strBarCode,"_")>0 then
       debug.print mid(strBarCode,intPosition,instr(intposition,strBarCode,"_"))
       intPosition=instr(intposition,strBarCode,"_")+1
     endif
   Looop until intPosition=0

Or something like that. I can't test it here, but if you can wait a day I can test this when I get back to the office. I'm happy to spent half an hour or so doing a spreadsheet that will take barcode as input into Cell A1 and parse out the fields and pop them into some other cells for you. Beyond the half an hour we'd need to work something out.

Cheers,

can ASP work with Barcode scanner.?how to write the code?thanx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.