Barcode scan

K

krgatez

I am working with Access 2003. I'm trying to develop an Asset
tracking database. The Assets are recorded using a barcode scanner
with a specific ID number. The ID's have a % on the front and back
(%ERI00102PR%).

I want to be able to scan these ID's without seeing the %'s. The
problem is that it may be scanned in multiple forms (search, reports,
add new). Scanning them into a text or combo box to do a search or
to add to a table. I don't think an update query would work on the
form level. I'm kind of new to this, so any help would be
appreciated!

Thanks in advance!
 
T

Tony Toews

I am working with Access 2003. I'm trying to develop an Asset
tracking database. The Assets are recorded using a barcode scanner
with a specific ID number. The ID's have a % on the front and back
(%ERI00102PR%).

I want to be able to scan these ID's without seeing the %'s. The
problem is that it may be scanned in multiple forms (search, reports,
add new). Scanning them into a text or combo box to do a search or
to add to a table. I don't think an update query would work on the
form level. I'm kind of new to this, so any help would be
appreciated!

You may be able to program the scanner to ignore the leading and
trailing %s.

Otherwise you may need a few lines of VBA code called by each control
where you can scan in the asset which will strip out the %s if
present.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 
K

krgatez

Tony Toews said:
You may be able to program the scanner to ignore the leading and
trailing %s.

Otherwise you may need a few lines of VBA code called by each control
where you can scan in the asset which will strip out the %s if
present.

Tony

I have gotten the formatting of the %'s for lost focus event.
Dim Str as String

If Len(cboProductID1) = 12 Then
str= Left(Right([cboProductID1], Len([cboProductID1]) - 1),
Len([cboProductID1]) - 2)
cboProductID1 = NewData
End If

Now I am trying to work with a combobox with 4 columns. I am still
working with the barcode scanner, with the % on front and end. The
problem is that the Not In List event checks the values as soon as it
is entered. How can I format the value before it validates the
combobox list?
 
T

Tony Toews

I have gotten the formatting of the %'s for lost focus event.
Dim Str as String

If Len(cboProductID1) = 12 Then
str= Left(Right([cboProductID1], Len([cboProductID1]) - 1),
Len([cboProductID1]) - 2)
cboProductID1 = NewData
End If

Personally I would've checked for %s before and after rather than
assuming the length included the %s.

For example (air code follows)
If left(cboProductID1,1) = "%" then
cboProductID1 = mid(cboProductID1,2)
endif
If right(cboProductID1,1) = "%" then
cboProductID1 = left(cboProductID1,len(cboProductID1)-1)
endif
Now I am trying to work with a combobox with 4 columns. I am still
working with the barcode scanner, with the % on front and end. The
problem is that the Not In List event checks the values as soon as it
is entered. How can I format the value before it validates the
combobox list?

Call this routine as the first line in the NotInList event. The
NotInList event is just some code right?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top