Forum Discussion
How to keep combo box data from change between forms?
- Jan 25, 2022Are these by any chance "cascading combo boxes" where the list of records in one box is filtered by the choice in another? For example, if you pick a state in Box1 then you'll see only a list of cities from that state in Box2. If that's the case, then that would explain why you're not seeing any values. They're not in the list of options that combo box has because it's filtered. You'll need to requery the combo boxes in the OnCurrent event. https://599cd.com/OnCurrent
Ok, the only difference I can tell in the other combo boxes are the fields they pull the info from. But the scripts are similar and they are pulling the correct fields depending on the selection of the previous combo box. So far, good. The other combo box right below that one, which is one that does not show data between forms, also has the option of adding a new "pest_name" from a linked form. That is the only difference, but when I took this out, it did not work anyway, so I kept it.
Now, I have the following events associated with those particular combo boxes, and I think the problem may be here. Do I need to add another kind of script to these combo boxes, so that the "Pest_Type" is not the only thing that changes between each form? After all, the data is well saved into the table whenever I create a new record from the form. It just does not show up in the form view if I go back to previous form records.
- anasfsilvaJan 25, 2022Copper Contributor
Like I said, your tutorial videos are a must! Indeed these are cascading combo boxes and following you example, I just copied the requery scripts for those combo boxes into the OnCurrent event on the form and it is now working and showing just fine! Thank you!
I think I will have to do the same to the combo boxes of "building" and "room" because these are working just the same way, and so far I only worked in the same room. I bet that when I change the room, if the requery is not done on the form, then they won't show up either.
All best!