Accidently scanning equipment twice.

Status
Not open for further replies.

Hackcess2007

Registered User.
Local time
Today, 14:32
Joined
Mar 8, 2014
Messages
47
Hi all,
I split and implemented my equipment check in check out database probably before i did enough testing. The problem is I am finding problems and the reasons for them. I made a query to track the movement of our equipment in and out of the warehouse BUT, the end user is able to scan (accidentally) the same barcode number in the combo box during the same transaction. It would be great to use a marco or code to have the second instance of the barcode number open a message box and not allow the second entry saying " This was already scanned in" I am not strong with vba but I see the need to learn. Any help is always very much appreciated by you guys gals.
Thank you and have a great day!
 
I'm sure it can be done, but you need to explain how your tables and forms work - provide some examples. scanning the barcode is one thing, determining if it has already been scanned for this 'event' is another since presumably the same barcode is scanned 'in' and 'out' on a regular basis - is it several times a day (e.g. bowling shoes) or daily (e.g. dumper truck)

What I would expect is something like after scanning, the system would check what the previous scan was - if scanning 'in' and the previous scan was also an 'in' then reject, otherwise OK. Previous scan would probably be defined by date and/or time so something like this code in your combo afterupdate event would work

Code:
dim rst as dao.recordset
 
set rst=currentdb.openrecordset("SELECT TOP 1 Direction FROM tblBooking WHERE EquipmentCode='" & me.combo & "' ORDER BY BookDate Desc")
if rst!Direction="IN" then 'already booked in 
    msgbox "Already Booked In"
    me.combo=""
end if
set rst=nothing

This also assumes you have one 'booking' table to record both in and out transactions
 
Last edited:
Status
Not open for further replies.

Users who are viewing this thread

Back
Top Bottom