Results 1 to 8 of 8
  1. #1
    uresan is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2022
    Posts
    5

    Get value from another table


    Hello all,
    is it possible to create table where you write ID and field gets filled with value from another table.
    See photo attached.
    I'd like to have following automation. When I write ID in "Tabela2" I want field "tel" in "Tabela2" to be filled with value from field "tel" from "Tabela1" with same ID. Can this be done? If yes, how can I do that.
    Thank you in advance.
    Best regards,
    Attached Thumbnails Attached Thumbnails Posnetek zaslona 2022-06-13 105313.jpg  

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    It may be possible to do something like that while using forms but you would usually just display the data from the first table.

    Can you tell us more about what you are trying to do and why you feel the need to copy the data to another table.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Join Date
    Apr 2017
    Posts
    1,680
    This is really bad idea! An example why: Lets assume the some info about Janek Novak's phone number (ID = 1 in 1st table) was changed later. In another table(s), the previously entered phone numbers remain unchanged, and aren't valid anymore - you have to edit all tables containing phone numbers to correct the info about this phone number.

    When you store only phone number ID in any other tables except phone numbers table, and get all phone number info in forms/reports using this/those table(s) as source calculated only (using functions or queries getting info from phone numbers table), then any change in phone numbers table will be immediately available everywhere in your database. No additional edditing of other tables is needed!

  4. #4
    uresan is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2022
    Posts
    5
    For instance:

    1. I'd like to have table of articles (article ID and article Name)
    2. I'd like to have table of orders with article details (order ID, article ID, article Name), where I'd write article ID and article name will be filled automatically.
    3. When I edit article name in table of article I'd also like to article name gets updated in table of orders with article details

  5. #5
    Join Date
    Apr 2017
    Posts
    1,680
    And again, don't have article name in order's table - this will be a path to disaster! Article ID is all you need - the name can be calculated at any moment it will be needed.

    It looks like you are planning to work with tables directly. I don't advice this! The best practice will be to work with tables only when you create them. After that you better hide them from any users (yourself included), and use forms to edit data, add new data or delete it. Forms are much better at data handling - e.g. in Orders form you can easily have a combo box linked to article id, which displays article name instead.

  6. #6
    uresan is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2022
    Posts
    5
    I'd like to have it on table at form. See photo attached. So when user will write article ID, article name will be displayed. That is also enough.
    Attached Thumbnails Attached Thumbnails Posnetek zaslona 2022-06-13 125518.png  

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Is the picture that you posted a main form with a sub form, representing a one to many relationship between two related tables?
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  8. #8
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Please describe what you are trying to accomplish in simple terms. If English is not you language,then write a description in your own language and then using Google translate, convert your description to English and post in the thread.

    Prosim, opišite, kaj poskušate doseči na preprost način. Če angleščina ni vaš jezik, potem napišite opis v svojem jeziku in nato z Googlovim prevajalnikom pretvorite svoj opis v angleščino in objavite v temi.

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

Similar Threads

  1. Replies: 3
    Last Post: 03-31-2021, 10:31 AM
  2. Replies: 1
    Last Post: 03-31-2016, 03:33 AM
  3. Replies: 4
    Last Post: 08-30-2012, 07:58 PM
  4. Replies: 8
    Last Post: 03-22-2012, 08:48 AM
  5. Replies: 2
    Last Post: 10-27-2009, 07:09 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