Results 1 to 3 of 3
  1. #1
    m3zzr is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    2

    Auto populate fields from another table

    Hello,

    This is my first post and first time using Microsoft Access so apologies if this is not the right area for this question as it seems to fall across more than one section on this forum. I am hoping someone can point me in the right direction with what will probably be a simple solution.



    I currently have two tables,
    Table1 [BarcodeID, BarcodeNo, ItemName, ItemType]
    Table2 [ItemID, ScannedInDate, BarcodeNo, ItemName, ItemType]

    I have created a relationship between BarcodeNo fields.

    I have a form for Table2 which I want to use to enter delivered items. What I need to do is enter a barcode into 'BarcodeNo' field, and then it cross reference the barcode from the barcode table and then auto-populate the ItemName and ItemType fields.

    I have seen some tutorials on the internet that use a combo box and a OnChange VBA script but I need to be able to use a TextBox. My understanding is that I may have to use a Update After action but this is where I am stuck?
    If there is another simple way of doing this I would appreciate it?

  2. #2
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    If ItemName and ItemType fields exist in one place you don’t need to copy them to a new place.

    Put all the items in one table the primary key can be the barcode if its unique (I assume it is) or an auto number.

    When information is linked from one table to another then the information from both tables is relevant to that record. Duplicate data defeats the whole purpose of access.

    EG. barcode 1 will have item details such as name, weight/whatever. Then also it will have a new record for each scan of that item (based on the little we can see.)

    how you see data in the tables isn't designed to be easily readable. That’s where forms and reports come in.

    Hopefully I’ve made a little bit of sense. Feel free to ask questions, I'm sure you will soon get some homework to read about data normalisation.

  3. #3
    m3zzr is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2019
    Posts
    2
    Hi,

    Thank you for the reply, yes it has made sense to me at the moment. I will tinker about a bit more as this is a quick test for a larger database i want to design that will keep info about laptops/desktop make, model, serial number and asset name etc

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

Similar Threads

  1. Do related table fields auto populate
    By chriswrcg in forum Access
    Replies: 3
    Last Post: 10-07-2018, 12:53 PM
  2. Replies: 3
    Last Post: 09-05-2016, 10:56 AM
  3. Replies: 4
    Last Post: 04-04-2016, 08:11 AM
  4. Replies: 1
    Last Post: 06-24-2014, 01:31 PM
  5. Replies: 3
    Last Post: 05-03-2014, 11:00 AM

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