Rob4077
asked on
Requery in On GotFocus event of combo box dropdown appears then disappears
I have created a number of combo boxes that need to be refreshed when the user selects them as their rowsource is dependent on the contents of other fields. I have created an On GotFocus event that contains the command me.CboMyBox.requery. If I move from another field on the form to the combo box, the requery runs, the dropdown appears with the new list momentarily then disappears. If I then click on the dropdown again it works fine. Can anyone help me resolve this issue? I am using MS Access 2007
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for all your comments.
I remain confused by this one. What you say about the combo box working as hoped after the requery, mx, is what I have happen with many other applications where I use the same code. However on this one, and a few others, it behaves as carazuul explains it should. I don't understand this at all.
Anyway I will try the .dropdown method and see if that works as soon as I get access to the network again and confirm it works in my application. I agree with mx that it may be annoying in some instances but I think it may prove to be the best option.
I remain confused by this one. What you say about the combo box working as hoped after the requery, mx, is what I have happen with many other applications where I use the same code. However on this one, and a few others, it behaves as carazuul explains it should. I don't understand this at all.
Anyway I will try the .dropdown method and see if that works as soon as I get access to the network again and confirm it works in my application. I agree with mx that it may be annoying in some instances but I think it may prove to be the best option.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry for the delay in responding. I was hoping to have the time to convert to 2003 and post last night but didn't.
As a short term fix I tried this morning putting in the .dropdown after the .requery and it made no difference. This seems to imply that some other code is running after the .requery and the .dropdown doesn't it? I have tried stepping through the code but there doesn't appear to be anything else happening. Does this help identify the problem?
I will try to re-create the problem in a small 2003 database as soon as I can.
As a short term fix I tried this morning putting in the .dropdown after the .requery and it made no difference. This seems to imply that some other code is running after the .requery and the .dropdown doesn't it? I have tried stepping through the code but there doesn't appear to be anything else happening. Does this help identify the problem?
I will try to re-create the problem in a small 2003 database as soon as I can.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok will try to re-create today.
ASKER
I started to re-build and couldn't re-create the problem so I decided to just rebuild the control (dropdown). It works fine now. Must have been a corruption somewhere. Sorry I wasted so much of my time and even more sorry that I wasted yours. Thanks for all your help. Will apportion points as fairly as I can on the basis that your inputs led me to the conclusion. Thanks again.
ASKER