Results 1 to 13 of 13
  1. #1
    globs is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Posts
    5

    I need help making a form and query for searching for products in a table using a barcode scanner

    This is the table that stores all my products (inventory):
    http://i.imgur.com/KfTgrjf.png
    As you can see I am beginning to enter all the barcodes for each of the products. (I'm using a barcode scanning device which just acts like a keyboard input device after scanning a barcode)

    This is my attempt at making a form and query for searching for products using a barcode scanning device:
    http://i.imgur.com/bKh8E1h.png (before scanning a barcode)
    http://i.imgur.com/9mLFdob.png (after scanning a barcode)
    http://i.imgur.com/oxkvBhp.png (I have to scan again because of the window that pops up, see image directly above, but it work because the query fetches the correct product)

    The scanning device automatically presses enter after scanning a barcode and automatically inputting it as text.

    Can someone help me clean this up? I also have to close the query every time before performing another barcode search because the query won't update. Is there a way to add the query to the form and have it update everytime I scan a barcode with the scanner device?

    Here is the Access database file:
    https://mega.co.nz/#!E4hTCBwZ!Xy4Xaq...7Y5TrfNqBti3Io

  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,970
    Do data entry/edit in a form bound to query and it should automatically show new record after scan.
    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
    globs is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Posts
    5
    Quote Originally Posted by June7 View Post
    Do data entry/edit in a form bound to query and it should automatically show new record after scan.
    I don't understand. How do I set that up?

    I'm using Access as a front-end too because the store inventory is less than 500 items.

  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,970
    But now that I think about, a new record should also show if interacting directly with table/query. Should not have to close and reopen.

    Apparently you have already created a form. I don't know why it is prompting for parameter input.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  5. #5
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    imgur? lol

    you need to make a form for products, tied to the products table

    in the header of the form put an unboud textbox, [bar_cd_srch]
    use the afterupdate event of the textbox
    apply filter where prod_table.barcode = [bar_cd_srch]
    requery
    nullify [bar_cd_srch] so it is ready to search again

    if barcode exists, it will show the product else a new page

  6. #6
    globs is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Posts
    5
    Here is the db.
    Attached Files Attached Files

  7. #7
    globs is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Posts
    5
    Quote Originally Posted by qa12dx View Post
    imgur? lol

    you need to make a form for products, tied to the products table

    in the header of the form put an unboud textbox, [bar_cd_srch]
    use the afterupdate event of the textbox
    apply filter where prod_table.barcode = [bar_cd_srch]
    requery
    nullify [bar_cd_srch] so it is ready to search again

    if barcode exists, it will show the product else a new page
    Where do I enter "[bar_cd_srch]" and "prod_table.barcode = [bar_cd_srch]"?
    http://i.imgur.com/59SPpU0.png

    Sorry, I'm new to this.

  8. #8
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    what is it you want to do? just look up products?

  9. #9
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    see this eg.

    also dont leave text fields in table the default 255. make it as much as u need, else bloated db
    also you dont want "like" to find bar code. it should point to only one product..
    Attached Files Attached Files

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,970
    Modify the form like:

    1. select all the controls on the form and right click > Layout > Remove

    2. move the barcode search box to the form Header section

    3. set the form RecordSource property to the parameterized query

    4. might want to change the query parameter to:
    Like [Forms]![ProductBarcodeSearchF]![txtProductBarcodeSearch] & "*" Or Is Null

    5. create textboxes in the form Detail section and bind them to query fields

    6. delete the embedded macro that opens the parameterized query

    7. need code in the search box AfterUpdate event to Requery the form - I don't know how to do with macro so here is the VBA

    Private Sub txtProductBarcodeSearch_AfterUpdate()
    Me.Requery
    End Sub
    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.

  11. #11
    globs is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Sep 2014
    Posts
    5
    Quote Originally Posted by qa12dx View Post
    see this eg.

    also dont leave text fields in table the default 255. make it as much as u need, else bloated db
    also you dont want "like" to find bar code. it should point to only one product..
    That's what I wanted, thank you.

    Is there a way to make everything else in the form read-only except for the barcode search? And is there a way to keep the stuff entered into the barcode search highlighted all the time?

    Currently the scanner has a CR suffix, but it can be disabled.

  12. #12
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    highlight all the fields you want to lock.
    data - locked - yes
    other - tab stop - no

    to highlight the barcode search
    add in the after update macro
    sendkeys - {f2}

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,970
    Using the * wildcard in the parameter allows all records to display if no value entered in the search box.

    Also, set form properties like:

    Allow Additions No
    Allow Deletions No
    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. Replies: 1
    Last Post: 01-10-2014, 08:56 AM
  2. Replies: 1
    Last Post: 11-16-2012, 02:56 AM
  3. Replies: 8
    Last Post: 04-24-2012, 01:05 PM
  4. Barcode scanner for small project
    By miziri in forum Programming
    Replies: 7
    Last Post: 05-20-2011, 01:50 AM
  5. Replies: 1
    Last Post: 12-30-2008, 08:58 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