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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bar Code Scanner Input into a form

Status
Not open for further replies.

Jons9er

Technical User
Jan 7, 2005
4
US
Hi All,

You have all been so helpfull in the past, I'm hoping someone can help me again. I'm definitely not an access expert by no means but do make quite a few databases at work.

On our production orders at work, we have bar codes for all our products. The bar code contains a text strings of information that pertains to the product and the order. The information is always in the same order I just need it disected into different fields instead of the enter string in one field. What I would like to be able to do is scan the production order's bar code and disect the information into different fields in the same record.

Here is what the text string looks like from the Bar Code:

0.19,3750,1800,AC,FWC732E1800B5GCUB , ,521042, ,00002,1, , , , , ,38835.042,884107018881,D00130 ,

I'm sure there is an easy way to do this I just don't know how but what I want is everytime there is a "," in the text string I would like it to tab to the next field and then to repeart for each comma there after. Basically just the same as in excel where it delimits the information based on where the commas fall.

Any suggestions?

Thanks,
Jon

 
How about Split? It will give you an array:
[tt]astrArray=Split(Me.BarCodeField,",")
Me.txtText1=astrArray(0)
<...>[/tt]
 
I tried this one the Barcode field:
Private Sub Field1_Enter()
astrArray = Split(Me.Field1, ",")
Me.txttext1 = astrArray(0)
<...>

Field1 is the name of the barcode field. all that is being returned is:
Compile error:
method or data member not found and it is highlighting the Txttext1 =.

I have never used an array what should happen should the text field split into the other fields?
 
Yes it should. Me.txtText1 was just an example of another textbox on your form.
You can list the items in the array like this:
[tt]astrArray = Split(Me.Field1, ",")

For i = 0 To UBound(astrArray )
Debug.Print astrArray(i)
Next[/tt]
 
While "Split" works for the data received, you should get the literature on the specific bar code reader and the code type. Most modern / current bar code readers can actually sen the seperated parts (segments) of the bar code and the normal course of processing is to supply a seperate bar code capture form specifically to accept the scanned data and properly allocate it to the individual fields/controls. The normal process then return the individual fields to the main application. Since each bar code reader has different approaches to this, you need to get, read and implement the process seperatly for each model of bar code reader,




MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top