Page 1 of 3 123 LastLast
Results 1 to 15 of 33
  1. #1
    pdanes is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Sep 2019
    Posts
    208

    Refresh displayed value in ribbon dropdown


    I have a dropdown in a ribbon, displaying records from a table, and a form that can change the values in the table. When I change the table, I need to update the dropdown.

    The contents of the dropdown list I have been able to update without a problem. I run DataRibbon.InvalidateControl "rDZtS_ddnDruhData" and it re-populates the entire dropdown, EXCEPT for the currently displayed (selected) value.

    Say I have in the table:
    AAA
    BBB
    CCC
    DDD
    EEE
    And I have selected from the dropdown BBB, which is what is currently showing in the non-dropped window. I go to the table edit form, change BBB to BZZ. I have custom event procedures that trigger various things that change around the app, including this ribbon dropdown. When I enter the dropdown afterwards, and click the arrow to expand the list, the change has taken place – the second position now shows BZZ, instead of the original BBB. That is all fine, but the DISPLAYED value remains BBB. I can now select BZZ, and once I do, BBB is no longer even visible. However, I want that displayed value of BBB to ALSO change to BZZ when the dropdown is updated.

    How do I make that happen?

  2. #2
    pdanes is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Really? Nobody even has an idea?

  3. #3
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Really? Nobody even has an idea?
    Pretty hard for me to follow your description. Maybe some images would help.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    I read that as "my ribbon list refreshes but my form does not"
    Then requery the form? That assumes there is a link between a pk of the displayed record(s) and the ribbon control list.

    Really? Nobody even has an idea?
    I think something like a simple 'bump' comment will get you more sympathy. This is the first time I saw this thread.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    pdanes is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by Micron View Post
    I read that as "my ribbon list refreshes but my form does not"
    No - the value displayed in the dropdown box of the RIBBON control does not update. The underlying list does, but the DISPLAYED - SELECTED value, which shows in the window after the dropdown collapses again does not update. The result is that it shows a value that no longer exists in the underlying list.


    I think something like a simple 'bump' comment will get you more sympathy. This is the first time I saw this thread.
    Well, I didn't want to be annoying, so I let it sit for a week. I guess it got pushed down so far by newer posts that it dropped of the radar.

  6. #6
    pdanes is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by davegri View Post
    Pretty hard for me to follow your description. Maybe some images would help.
    Okay, I'm heading in to work - I'll try to take some screen shots there.

  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    I can make a suggestion based on form control design but you have me at a disadvantage when it comes to controls in the ribbon.

    Then you need to requery the control, which will remove the displayed value. If you're expecting it to change to the new value then you would first have to know the unique record ID of the old value. **If you don't have that in the list (even if hidden), then I'd say you're beat if you expect then old value to change to the new. You could try using the list index value (basically the list row number) but if the list is ordered on the shown value, it will likely occupy a new position. The only option then is to re-select from the list, choosing the edited value.

    EDIT
    ** - I'm saying it's a multi-step process:
    . get the row index or list ID
    . edit the value
    . requery the control to refresh the list
    . make the control value (display) equal to the value at the position of the list row index or list ID
    Last edited by Micron; 02-03-2021 at 11:55 AM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    pdanes is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by Micron View Post
    I can make a suggestion based on form control design but you have me at a disadvantage when it comes to controls in the ribbon.

    Then you need to requery the control, which will remove the displayed value. If you're expecting it to change to the new value then you would first have to know the unique record ID of the old value. **If you don't have that in the list (even if hidden), then I'd say you're beat if you expect then old value to change to the new. You could try using the list index value (basically the list row number) but if the list is ordered on the shown value, it will likely occupy a new position. The only option then is to re-select from the list, choosing the edited value.

    EDIT
    ** - I'm saying it's a multi-step process:
    . get the row index or list ID
    . edit the value
    . requery the control to refresh the list
    . make the control value (display) equal to the value at the position of the list row index or list ID
    Thank you for the suggestions, but I know how to do it in a form. It's the ribbon that's giving me fits.

  9. #9
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    I don't have the time to build from scratch and test, but if you want to post a zipped db copy I would be willing to take a stab at it.
    Last thought I have at present is that in order to do what you want you have to make this a combo box in the ribbon - not a drop down, but that's just from some high level research. Not sure which it is you have, but I originally took it to be a combo. People use drop down a lot when they really mean combo so I had a bias there.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    pdanes is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by davegri View Post
    Pretty hard for me to follow your description. Maybe some images would help.
    Here you are. The first image is the form initially. Nothing is selected in the ribbon dropdown, but it is expanded, showing the contents. I will select the third element - Ammotragus lervia.

    In the next image, the third element has been selected. The dropdown has closed, and the form has filtered for those species. The visible window of the dropdown contains that selected third element.

    I then go to a dialog form that lets me edit those names that appear in the dropdown. I change Ammotragus lervia to Ammotragus zzzzzz.

    In the third image, the change has taken place successfully. I invalidated the dropdown to re-populate it with the newly changed item. When I once again expand the dropdown, you see that the third element has indeed changed, to zzzzzz. But what is displayed in the non-collapsible window of the dropdown is still the original text - lervia. The window is displaying something that no longer exists in the database, and no longer exists even in the dropdown itself. It is a relic, not refreshed when the dropdown is re-populated. THAT is what I am trying to fix. I know how to make that happen in a combobox on an Access form, no problem. But I don't know how to do it with a ribbon's dropdown control.
    Attached Thumbnails Attached Thumbnails RibDD1.png   RibDD2.png   RibDD3.png  

  11. #11
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Sorry I can't help. I've never seen the ribbon used in this way before - mainly because I've never seen that design approach. I think conventional design with combobox would accomplish your goals.
    So, as they say in Sharktank, "I'm out".

  12. #12
    pdanes is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by davegri View Post
    Sorry I can't help. I've never seen the ribbon used in this way before - mainly because I've never seen that design approach. I think conventional design with combobox would accomplish your goals.
    So, as they say in Sharktank, "I'm out".
    Yes, a combobox on the form would certainly work. However, this form is fairly crowded, which is why I went with the ribbon approach - trying to keep most of the active elements there and only data on the form. Didn't quite pull it off - I have a few command buttons scattered here and there, but mostly. It seems to me there must be a way to do this, but run-time debugging of ribbon code is a major PIA. You don't have nearly the capability and flexibility that form controls give you. But there are other advantages, and it seems to be the way Office apps are heading, so I'm trying to get a grip on it. Thanks for taking a look.

  13. #13
    pdanes is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by Micron View Post
    I don't have the time to build from scratch and test, but if you want to post a zipped db copy I would be willing to take a stab at it.
    Last thought I have at present is that in order to do what you want you have to make this a combo box in the ribbon - not a drop down, but that's just from some high level research. Not sure which it is you have, but I originally took it to be a combo. People use drop down a lot when they really mean combo so I had a bias there.
    Hm, I thought it was a dropdown, but checking the XML, I now see that it's a combobox. I have several of these projects going at once, and I have comboboxes in some, dropdowns in others. I remember reading something about the differences between the two, but I don't recall off the top of my head exactly what those differences are. Do you think it might make a difference which I use? Do you know how to do it for one, but not the other?

    I can send you a copy of the DB, but I suspect it won't work for you. It's built in a Czech version of Access, and I have had problems sending such databases before, where the diacritical marks peculiar to the Czech language make the ribbon XML unreadable by English versions. Also, it has some proprietary scientific data in it, so I would have to hash it up before I could send it to anyone.

  14. #14
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    I have no experience with either (in a ribbon) but usually have success with code. I was only going by web search results whereby others reported similar or the exact issue and thought I might learn something in the effort. If you haven't done that search, then that would be my next suggestion because I don't know if there are any Czech people here who help out. If that doesn't work out, perhaps start a new thread here with a title that catches the attention of such a person and include a link to this thread. If you keep the title short you can make it bilingual, and use both languages in the post too.

    Failing all that, the easiest is probably to migrate the functionality to a form. Perhaps a popup 'selection form' that can be moved around on the screen if you don't have room, or just popup and then close. Fonts and controls in the pic look rather large so you might find there is some room to be had if the picture scale is accurate.

    Last but not least I suppose, would be for you to copy/compact/zip the db and Google translate the xml and post it here. You could remove any objects not related to the problem and perhaps use this as your hash. Then anyone who wants to take a shot at it can do so.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  15. #15
    pdanes is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Sep 2019
    Posts
    208
    Quote Originally Posted by Micron View Post
    I have no experience with either (in a ribbon) but usually have success with code. I was only going by web search results whereby others reported similar or the exact issue and thought I might learn something in the effort. If you haven't done that search, then that would be my next suggestion because I don't know if there are any Czech people here who help out. If that doesn't work out, perhaps start a new thread here with a title that catches the attention of such a person and include a link to this thread. If you keep the title short you can make it bilingual, and use both languages in the post too.

    Failing all that, the easiest is probably to migrate the functionality to a form. Perhaps a popup 'selection form' that can be moved around on the screen if you don't have room, or just popup and then close. Fonts and controls in the pic look rather large so you might find there is some room to be had if the picture scale is accurate.

    Last but not least I suppose, would be for you to copy/compact/zip the db and Google translate the xml and post it here. You could remove any objects not related to the problem and perhaps use this as your hash. Then anyone who wants to take a shot at it can do so.
    Thanks, I'll see what I can do. Maybe more useful would be for me to knock together a small DB with this problem and without any Czech characters to complicate things. This DB is also fairly large, so you would have to wade through a lot of code to pick out the pieces in this puzzle.

    I know of numerous other ways to accomplish the ultimate goal, but I want to use this. The functionality is great, and introducing some new element, like a pop-up or a form control would disrupt the entire concept. I don't want to migrate everything to a pop-up form, and having parts of the filtering in the ribbon and other parts in a pop-up is not a design I would be happy releasing. I can actually live with it the way it is, since the incorrectly displayed old value doesn't really impact performance. As long as no new selection is made, the old one is still valid, even though the box shows a non-existant value. When a new selection is made, that old value vanishes into the ether, and only valid ones appear from then on. It just irks me a bit - seems untidy to leave it there, even though it doesn't really hurt anything.

    I've looked around on the web and found all sorts of advice, but none of it useful. Maybe I'm using the wrong search terms, but I've found nothing addressing this specific issue. And specifically Czech people are not the sort of advice I need. This is a technical issue, not a language issue.

    Yes, the font is large - the user (single) is over 70, and type size is an issue.

Page 1 of 3 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 07-29-2018, 09:09 AM
  2. Replies: 9
    Last Post: 10-23-2017, 06:32 PM
  3. Replies: 1
    Last Post: 07-09-2014, 03:36 PM
  4. Access 2010 Refresh VS Refresh ALL
    By Snwboarder1982 in forum Access
    Replies: 1
    Last Post: 09-09-2011, 04:07 PM
  5. Invalidating dropdown control on Access 2007 ribbon
    By kenwarthen in forum Programming
    Replies: 0
    Last Post: 08-16-2010, 09:29 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