Wow. Thank you! It works perfectly now.
So Column(0,0) is an array and we are setting the value to the first row and first column in the first row?
It works perfectly in the sense that list 3 becomes empty when list 1 is changed. I was expecting though that this code would "select" the first row in list 2, and that the records in list 3 would reflect the first row in list 2.
Instead, list 3 empties, which is great, but I would like to understand why if you have the time to explain.
Again, thank you!
---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :
David-
You're close with your first attempt. What you need to do after the requery of lst2 is to set it to the first value in the newly filtered list, then requery lst3.
Me.lst2.Requery
Me.lst2 = Me.lst2.Column(0, 0) ' Assumes first column is the bound column
Me.lst3.Requery
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
(Paris, France)
On Mar 5, 2017, at 6:02 PM, david.pratt@... [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
I am experiencing now what you are saying about the Requery not firing an Update. When I change list 1, list 2 gets updated by the Requery, but list 3 does not get updated by its Requery. I need to figure out how to make list 3 not show incorrect data. When I update list 1, the requery updated list 2, but the requery does not update list 3. List 3 displays "old records" since the user has not yet made a choice for list 2. So I need somehow to clear list 3 of any "old records" and have list 3 be empty until a selection is made in list 2.
I tried to set a value in list 2, hoping that would cause lst3 to be updated, by adding the lines below in the After Update for list 1:
me.lst2.requery
me.lst2.Selected(0) = True
me.lst3.requery
But that didn't work and I am not sure why. List 3 does not get updated with this code.
Next I unsuccessfully tried clearing list 3 in the After Update event for list 1 with:
me.lst2.requery
me.lst3.value = ""
But that does not clear list 3; it still shows "old records".
Then I tried
me.lst3.RowSource = ""
That cleared list 3, but permanently cleared it, and after thinking about it, I see why. I completely changed the RowSource for list 3. To make this work, I think I would then need to change the RowSource back with code and SQL.
So when list 1 is changed, is there a way to clear list 3, or update list 3, without changing the RowSource property?
__._,_.___
Posted by: david.pratt@outlook.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (6) |
Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.
.
__,_._,___
Tidak ada komentar:
Posting Komentar