MS Access - looking for help with some 'under the hood' coding.

%3CLINGO-SUB%20id%3D%22lingo-sub-2405267%22%20slang%3D%22en-US%22%3EMS%20Access%20-%20looking%20for%20help%20with%20some%20'under%20the%20hood'%20coding.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2405267%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20developed%20a%20chromebook%20inventory%20database.%26nbsp%3B%20What%20I%20would%20like%20to%20do%20is%20'check%20in'%20chromebooks%20that%20have%20been%20returned%20by%20using%20a%20barcode%20scanner.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20table%20that%20has%20the%20asset%20tag%2C%20other%20info%2C%20and%20a%20y%2Fn%20check%20in%20box%20and%20a%20date%20field%20for%20CheckInDate%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I%20would%20like%20to%20have%20happen%20is%20to%20click%20a%20button%20on%20my%20main%20menu%20that%20opens%20this%20check%20in%20form%2C%20the%20form%20(or%20currently%20underlying%20query)%20request%20the%20chomebook%20asset%20%23%20be%20entered%20in%20the%20pop-up%20window.%26nbsp%3B%20The%20barcode%20is%20scanned%2C%20the%20value%20enters%20in%20the%20pop-upbox%2C%20and%20the%20info%20attached%20to%20that%20chromebook%20asset%20tag%20is%20returned.%26nbsp%3B%20This%20all%20works%20well%20currently.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20where%20I'm%20having%20trouble.%26nbsp%3B%20Updating%20(via%20SQL%2C%20VBA%2C%20Update%20query)%20the%20yes%2Fno%20field%20to%20Yes%20and%20the%20CheckinDate%20field%20with%20the%20current%20date%2C%20closing%20the%20record%2C%20and%20opening%20the%20form%20again%20triggering%20the%20pop-up%20box%20again%20to%20scan%20the%20next%20chromebook%20all%20without%20touching%20the%20keyboard.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20having%20trouble%20identifying%20the%20best%20method%20for%20doing%20that%20in%20the%20syntax%20to%20do%20so.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20was%20trying%20'after%20update'%20event%20option%20of%20the%20CBTAG%20field%20to%20run%20a%20macro%20or%20update%20query%20with%20-%20no%20luck.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20thoughts%3F%26nbsp%3B%20syntax%20suggestions%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2405267%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2010%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E2013%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E2016%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

I have developed a chromebook inventory database.  What I would like to do is 'check in' chromebooks that have been returned by using a barcode scanner.

 

I have a table that has the asset tag, other info, and a y/n check in box and a date field for CheckInDate

 

What I would like to have happen is to click a button on my main menu that opens this check in form, the form (or currently underlying query) request the chomebook asset # be entered in the pop-up window.  The barcode is scanned, the value enters in the pop-upbox, and the info attached to that chromebook asset tag is returned.  This all works well currently.

 

Here's where I'm having trouble.  Updating (via SQL, VBA, Update query) the yes/no field to Yes and the CheckinDate field with the current date, closing the record, and opening the form again triggering the pop-up box again to scan the next chromebook all without touching the keyboard.

 

I'm having trouble identifying the best method for doing that and the syntax to do so. 

 

I was trying 'after update' event option of the CBTAG field to run a macro or update query with - no luck.

 

Any thoughts?  syntax suggestions?

 

 

1 Reply
Hello Gregory,

I could think of a solution with the (VBA) timer-event of the pop-up form that checks if a scan occurred. I would set the timer to fire every x milliseconds and within (the VBA) Form_Timer subroutine I would execute the following 'actions':

1. Check with an If-statement if the asset # is filled (by the barcode scanner).
2. If asset # is filled, run a query with DoCmd.RunSQL to UPDATE the yes/no field and the Checkindate.
3 Empty the asset # field (with something like Me.txtAssetNo = ""); reset the tag-info if needed.

This way the pop-up stays open, waiting for the next scan. And if that happens, the timer-event processes the next scan. No keyboard or mouse action needed.

Hope this helps.

Best regards,
Tieme