Note that script triggers in 10 and 11 give you options that you do not have in 9.
Define two tables (can be two occurrences of the same table if you wish). CheckIN, IDCards
Relate them by barcode:
CheckIN::ScannedCode = IDCards::BarCode
Create a layout for CheckIN. Put ScannedCode on it, plus the photo, name etc. fields from IDcards that you want to display the matching data for a scanned barcode. Configure the ScannedCode field to select entire contents on entry so that each time you scan data into this field, it overwrites any previously entered data.
Consult the technical info for your scanner and configure it to append an Enter key character to the end of the scanned data.
Write this script:
Go To Field [CheckIn::ScannedCode]
Add a button on the layout that uses Halt script to halt this script's infinite loop when you need to quit and shut down the database.
The enter key character will continue past the pause, so each time you scan a barcode, it will look up the customer's data and pause waiting for the next scan.
Note, if your barcode reader should ever stop working, a user can type in the barcode and press the Enter key to process customers into your building.
Great script, it worked perfectly !!!! I follow your advice exactly as you mentioned and I couldn´t believe it was so simple yet so powerfull. I guess one sometimes just gets too confused and can´t imagine doing things simply. Thanks !!!
I have yet another thing I would like to accomplish, but how it´s possible to save each of the scanned codes to a record so I can keep track of who got in, like an access control system or log ?? because with your script, I can "recall" all the data for a certain customer code, but how do I keep it for my records ??
As always, thank you very much for any all the help..
Make ScannedCode a field with global storage enabled.
Add script steps like these after the commit Record step:
go to layout [Access Log (Access Log)]
Set Field [Access Log::ScanCode ; CheckIN::ScannedCode]
Go To layout [Original Layout]
in Access Log, you can define a timestamp field that auto-enters the creation time stamp to log the time and date when the bar code was scanned. A relationship based on ScanCode field can link these records to IDCards table so that you can use fields from the IDCards table on this Access Log layout to show who's card was scanned.
MANY THANKS !!!! Sorry for my late reply, I was out of the office for some days but I did exactly as you described, and everything worked great. I even add a counter to the AccessLog table, so each record would have its own serial number so I can keep trace of each record.
Hi, I´m trying to add something to my access control database, and is as follows:
I don´t want people to check twice their cards in a certain time period, lets say between 8:00 and 12:00, the system should only register 1 mark (entrance) and not let register the sme card twice or any more, how can I validate this ? If for any reason the card had passed already, I don´t want to have more than 1 record for it.
Thanks for your replies !
How will you specify that time period?
No additional entries within 4 hours of the initial entry or is this only to take palce in the 8 - 12 time frame every day?
Why do you want to do this? (What problem does it solve for you?)
Personally, I'd be inclined to log every entry and exit and then, if necessary, reduce the number of entries displayed when generating reports from it.
Thanks for your reply, let me explain a little more what I´m doing.... when I read the barcode from the access card, it automatically (thru a script) prints a ticket with a timestamped barcode of when that person went in. When he goes out, he has to show the ticket at a control gate, so they can calculate how much time he was in the building.
The problem is that sometimes, people pass the access card twice at the same time and it gives them 2 tickets (one for each pass) instead of only one, so I want to validate that if the access card has already been read, that it doesn´t let you pass it again, maybe until a certain amount of time, so it validates that you already passed the card.
The other thing I´m trying to do with this same database but modifyng it a bit is for an access control to an event party, in which I don´t want that guests (which have an invitation with a barcode printed on it as an "access code") can use again the invitation by passing it or lending it to someone else and getting inside, so once you read it at the first time, it won´t let you read it again because the system should not let you in and say that the code has already been used and you can´t access again.... kind of the same that I want to do with the other option above. If the guest wants to go out again, there will be someone on the gate that will stamp his arm with a rubberstamp with invisible ink or give you a bracelet...
As always, thanks a lot for your help.
Ok, then we don't need an interval in hours. You just need to set your script to check the log for a record that shows they have entered, but not yet exited. If the time interval is a minute (Or some such small interval), it can ignore the second swipe through the barcode reader. If it is longer than that, it can pop up an error message telling security that the ID code was already used to enter the building. Depending on how "tight" the building's security, you may need to enable an "override" option with additional details (such as the ID of the person authorizing the override) logged if it's possible for someone (say a VIP in a hurry...) to exit and not use their bar code to log out...
You can perform a find for a log record with the same code, but put an = operator in the "time out" field to search for any records in the system that logged someone in with the same code but who have not been logged out. If no records found, then procede with standard entry log. If record is found, check time interval by comparing Get ( CurrentTime ) or Get ( CurrentTimeStamp ) with current data in the time out field. YOu may want to enable a special "party" mode or check for a specific "party" barcode (maybe codes have more digits are all start with a specific character or characters...) if you need to process those access events differently from standard usage.