Results 1 to 4 of 4
  1. #1
    computersnack is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    6

    Date/Time Stamp on barcode input form

    I have a barcode input form. When a barcode is scanned, the value of the barcode, along with a date/time stamp using the now() function (hh:mm:ss) is entered into a table in the database as 2 separete columns. I need to make sure that I don't have any 2 barcodes with exactly the same date/time. They must be at least 1 second apart. How can I easily make this happen? I can't control how many times the barcode actually gets scanned. Any ideas? Thank you.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    One way is to set the two fields as unique compound index. Access won't allow duplicate and will message the user.

    Otherwise, use code to lookup the combination in table.

    I should think it extremely unlikely the same barcode will be scanned more than once per second. So maybe the intrinsic feature will be sufficient for those rare instances.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    computersnack is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    6
    Quote Originally Posted by June7 View Post
    One way is to set the two fields as unique compound index. Access won't allow duplicate and will message the user.

    Otherwise, use code to lookup the combination in table.

    I should think it extremely unlikely the same barcode will be scanned more than once per second. So maybe the intrinsic feature will be sufficient for those rare instances.
    Well, that would work except I don't want it to message the user. Also, it is possible to scan more than once per second because I can simulate it on a keyboard by pressing a key multiple times. And also I plan to have multiple barcode scanners.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,919
    But in reality, how will the scanning take place? User has to pick up item, find the bar code, click button on wand or pass item over a scan table?

    Maybe VBA error handler code can capture the error triggered by the index violation. Otherwise, code in the form BeforeUpdate event to search table for the combination.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Barcode input form
    By computersnack in forum Access
    Replies: 1
    Last Post: 04-24-2014, 01:05 AM
  2. Column history - date and time stamp
    By Hatye in forum Access
    Replies: 5
    Last Post: 11-15-2013, 01:26 PM
  3. Replies: 3
    Last Post: 12-10-2012, 05:14 PM
  4. Date and Time Stamp
    By zoooza84 in forum Access
    Replies: 2
    Last Post: 08-06-2011, 04:53 AM
  5. Replies: 4
    Last Post: 01-30-2010, 05:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums