Results 1 to 4 of 4
  1. #1
    Mehvan's Avatar
    Mehvan is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    133

    Post Auto fill fields when we use Barcode or ItemName

    Hello Everyone

    How can I Auto fill fields , when I choose Barcode or ItemName ?


    it auto fills fields when I choose Barcode , but When I choose ItemName only auto fill price field , Barcode doesn't fill .
    Database1.zip

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    Remove the on error resume next and you will see why. You will need to rethink the relationships and your table structures.

    Cheers,
    Vlad

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    1. change form RecordSource to just ID table

    2. change combobox properties:
    ControlSource: Barcode
    RowSource: SELECT Barcode, ItemName, Price FROM Items;
    ColumnCount: 3
    ColumnWidths: 0";1.0";0.5"

    3. change Price textbox ControlSource to: =[ItemName].[Column](2)

    4. eliminate the VBA

    5. change ID field in ID table to autonumber or delete the field because it is not being used for anything

    6. give ID table a better name
    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.

  4. #4
    Mehvan's Avatar
    Mehvan is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2016
    Posts
    133
    thanks a lot
    I solved it , I changed ItemName and Barcode to Combo box , and I removed relationship between barcode , I made relationship between ID

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

Similar Threads

  1. auto fill fields based on another field
    By dbell in forum Forms
    Replies: 18
    Last Post: 05-26-2014, 01:46 PM
  2. Replies: 3
    Last Post: 03-15-2013, 03:27 PM
  3. Replies: 3
    Last Post: 03-21-2012, 01:43 PM
  4. Auto-Fill text fields in the form
    By sk88 in forum Access
    Replies: 2
    Last Post: 01-10-2012, 08:22 PM
  5. auto fill certain text fields?
    By darklite in forum Forms
    Replies: 4
    Last Post: 07-12-2010, 02:20 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