Barcoding (1 Viewer)

Ricky

Registered User.
Local time
Today, 18:51
Joined
May 30, 2000
Messages
13
I have a huge project coming up where my CSRs will be scanning barcodes into an Access 2000 form.

Problem is, during test phases I have not found a way to pull data from a table when the scanner scans the barcode in. There is a unique employee id which is the barcode. When the CSR scans the barcode, I would like it to pull the employee record and hop to the next field if possible populate the employee fields based on employee id.

Hopefully this makes sense. Anyone have any suggestions? Thanks,

Ricky
rcielma@gll.com

Layout:

Master Table:

Employee ID, Address fields, SSN, CODE, Signature check.

Form:

Employee ID (Scanned In) should populate address and misc fields. Move to CODE scan then move to Sig Check.

[This message has been edited by Ricky (edited 04-19-2001).]
 

charityg

Registered User.
Local time
Today, 18:51
Joined
Apr 17, 2001
Messages
634
After scanning will the barcode populate a numberic ID field? If so you should be able to lookup the fields with DAO. You could use a lookup query, but those fail more than they work.
Try:
employeeID_afterUpdate()
dim rst as recordset, db as database
set db=currentdb
set rst=db.openrecordset & _
("mastertable",dbopentable)
rst.index="primarykey" 'employeeid
rst.seek "=", Me!fldEmployeeID
if rst.nomatch=false
msgbox "No employees found.
exit sub
else
me!address=rst!address
me!miscfield=rst!miscfield
docmd.gotocontrol "code"
endif
set rst=nothing
I think I got all of the code right, but I'm notorious for typos so I wouldn't recommend cut-paste, but you get the general idea.
 

Ricky

Registered User.
Local time
Today, 18:51
Joined
May 30, 2000
Messages
13
Wow thanks charityg. I am pretty much a newbie at access db coding.

Question on code:

("mastertable",dbopentable)

Should that = ("Master",dbopentable) my records are in the table Master. Each field is bound to the records within master.

Thanks again.
 

charityg

Registered User.
Local time
Today, 18:51
Joined
Apr 17, 2001
Messages
634
Yes. That is the parameter where you declare the name of your table.
 

Ricky

Registered User.
Local time
Today, 18:51
Joined
May 30, 2000
Messages
13
Sorry for the repost. I am using

Code:
Private Sub txtID_AfterUpdate()
Dim rst As Recordset, db As database
Set db = GREAT2
Set rst = db.openrecordset & _
(GREAT2,dbopentable)
rst.Index = "1EID" 'employeeid
rst.Seek "=", "Main![txtID]"
If rst.nomatch = False Then
MsgBox "No employees found."
Exit Sub
Else
Me!Address = rst!Address
Me!miscfield = rst!miscfield
DoCmd.GoToControl "code"
End If
Set rst = Nothing
End Sub

and

Set rst = db.openrecordset & _
(GREAT2,dbopentable)

is in red. Any idea why?
 

Users who are viewing this thread

Top Bottom