Results 1 to 8 of 8
  1. #1
    Josh330 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2023
    Posts
    12

    Changing Inherited Value in Dropdown List when List Changes


    Hi there. I'm an advanced beginner at Access, but if someone could provide direction to me on the following issue that would be great. I would like to change an inherited value in a combo box in a datasheet form when the data in the source table changes. For example, if the source table has an option of "ABC" and the user has already selected that in the datasheet form, then if the user changes the name of that option to "ABCD" then I would like the dropdown to automatically change from "ABC" to "ABCD". The way it works now is that the user needs to go back to dropdown and select "ABCD" manually to overrise the inherited value of "ABC". This is obviously time consuming when there are hundreds of records.

    Any advice would be most appreciated?

    Thanks.

    Josh

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Please tell us more about user changing the values in some existing values in the table that supports your dropdown/combobox.
    What is the process? Perhaps you could give us an example with a little more detail.

    Is this a user whose role is to correct "misspellings" or similar?
    Why is "ABC" not correct? Who knew it should be "ABCD"?

  3. #3
    Josh330 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2023
    Posts
    12
    The dropdown box is a list of business units. The user is responsible for inputting the names of each of the business units in a Form. The user is only one that knows the name of the business units. So the user may input three business units: "ABC", "Test Unit", "Good People". In a separate continuous Form the user then inputs more information and one of the fields is business unit, so the user selects from one of those three business units. The issue is when the user realizes that the business name is incorrect and for example wants to change "Good People" to "Very Good People". The user knows about the business units, not the developer. That change has to be done manually and which I would like to automate.

    Thanks.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    If your DB was set up correctly, then you would be storing the ID of that record, not the value.
    THEN when you change the name, that is reflected immediately.

    I do it all the time for my Diabetes DB.

    Now if you wanted to keep track of when the name changes for some strange reason, you would store the name, then you would see when it actually changed, so you would have records as ABC, and then records wih ABCD, but you wanted that change visible.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    In a separate continuous Form
    That seems to me that the edits are being done in a separate form then the user goes back to the original form and doesn't see the changed value. Then the event that closes the form should requery the first form?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    Josh330 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2023
    Posts
    12
    Thanks Welshgasman. I forgot that I needed to do this.

  7. #7
    Join Date
    Apr 2017
    Posts
    1,681
    Quote Originally Posted by Josh330 View Post
    Thanks Welshgasman. I forgot that I needed to do this.
    It is never too late to correct this!

    As start, make a copy of your database!

    1. In design mode, rename your current combo source table. Like you had table tblUnits with field UnitName, and you change it to table tblUnitsOld;
    2. Create a new table, with same name as your old one. Like tblUnits: UnitID, UnitName (UnitID is autonumeric field). Set UnitID as primary key;
    3. Run an append query, which inserts all unit names from old units table into new one;
    4. In all other tables, which have UnitName field, add a new field for UnitID (either UnitID or UnitIDpK, in Long Number format);
    5. Update all those tables with UnitID values matching with unit names there, read from new units table. In case unit names there were used for indexing, edit those indexes, replacing unit name fields with unit ID fields;
    6. In all tables where unit id is now a foreign key, delete the field, which contains unit names;
    7. In all forms, where you had combos for selecting unit names, edit their rowsource, adding unit id field as 1st one into query string, and making only unit name field visible one;
    8. Delete old units table.

  8. #8
    Josh330 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2023
    Posts
    12
    Thank you so much.

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

Similar Threads

  1. Replies: 8
    Last Post: 12-13-2017, 10:38 AM
  2. Dropdown List Box-Memo List
    By trident in forum Forms
    Replies: 3
    Last Post: 11-19-2016, 12:29 PM
  3. Add to the dropdown list
    By tanyalee123 in forum Forms
    Replies: 1
    Last Post: 11-13-2013, 01:18 PM
  4. Dropdown list
    By stratack in forum Access
    Replies: 1
    Last Post: 07-25-2011, 06:58 AM
  5. Set up a dropdown List
    By asherbear in forum Access
    Replies: 2
    Last Post: 06-24-2010, 06:45 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