Results 1 to 4 of 4
  1. #1
    SmugglersBlues is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    8

    Option is True if Barcode matches

    Hi,
    I have a table with 3 fields (ID, Barcode, Scanned). I want to be able to scan barcodes and have the Scanned field set to True if the scanned number matches the value in Barcode. Is this possible to do? I did search the forums but didn't see anthing that matched this topic.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You want to know if the scanned barcode matches a value in a table of barcodes?

    Perhaps in the BeforeUpdate or AfterUpdate event of Barcode textbox, example VBA code:

    Me!Scanned = Not IsNull(DLookup("Barcode", "tblBarcodes", "Barcode=" & Me!Barcode))
    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
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    June7 the only thing I would add to your code is that many Bar codes are alphanumeric so I would put single quotes around the Me!Barcode.

    just an observation..
    Me!Scanned = Not IsNull(DLookup("Barcode","tblBarcodes","[Barcode]='" & me!Barcode & "'"))

    if you know it is numeric only you got it.

    hope this helps

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Yes, if the field is a text datatype need the apostrophe delimiters.
    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. set option button to true
    By crowegreg in forum Forms
    Replies: 2
    Last Post: 06-29-2012, 11:36 AM
  2. Access to filter semi matches.
    By Shido151 in forum Queries
    Replies: 1
    Last Post: 04-23-2012, 06:14 PM
  3. Partial Matches in a Parameter Value
    By Darkladymelz in forum Access
    Replies: 18
    Last Post: 03-06-2012, 12:02 PM
  4. Help: Comparison query to find non-matches
    By 14erclimber in forum Queries
    Replies: 6
    Last Post: 06-09-2010, 09:29 AM
  5. barcode
    By techker in forum Access
    Replies: 1
    Last Post: 02-21-2009, 09:04 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