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

Removing character when scanning

Status
Not open for further replies.

memcom

MIS
Nov 19, 2002
56
US
We have a symbol omnilink scanner and I want to replace the first character from a barcode with a different character when I scan it. Example: I scan a barcode "babc1234" and I want the result to be "#abc1234" The first character will always be "b" and the replacement character will always be "#" Is there any way to do this?

Thanks,
Michael
 
I would think it would be a trivial transformation for your underlying application.

Jim Asman
jlasman@telus.net
 
If you have the manual for the scanner
It should have and programming page in it to append a character(s) or prefix to the data just scanned.


DougP, MCP, A+
 
It appears you want to substitute a character. This can be done as well.


DougP, MCP, A+
 
memcom,
As jlasman said, simple transform.
Why not put a textbox on the forms and reports that use the [barcode] field and add as the controlsource;
="#" & mid([barcode],2,12]
(twelve is arbitrary. Use a number that is >= to the longest scan.) That way you always have the original scan.
jim
 
I am scanning into a program that I do not have access to changing. It is a small program and I only have the exe file.
 
Yes that is what I have. I just found the programming manual and I will try it in just a little while.
 
I was able to program the scanner so that after the scan was made, it sent the home key, the delete key, the character I wanted to add, the end key and then enter. It seems to have worked great.
 
Hi memcom,

I hope this code can help you.
Dim strReplace as string
Dim strChange as string


strReplace = UCase(Microsoft.VisualBasic.Left(txtbox.Text, 1))

'If first string in textbox = 'a', then replace 'a' by '#'
if strReplace = "a" then
strChange = textbox.text
strChange = Replace(strChange , strReplace , "#")
End if

Hope this help you.
 
textbox.text = "#" & mid(textbox.text,2,len(textbox.text))

===================================
Never underestimate the power of stupid people in big numbers
===================================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top