Link to home
Start Free TrialLog in
Avatar of Rob4077
Rob4077Flag for Australia

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
Avatar of carazuul
carazuul

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rob4077

ASKER

Nor sure that the answer is clear as to why this is happening or how to fix. What my users are doing is going from one field directly to the dropdown arrow on this field and they have to press it twice to get it to appear. Is the Me.CboMyBox.DropDown solution the best for me to use?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rob4077

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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rob4077

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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rob4077

ASKER

Ok will try to re-create today.
Avatar of Rob4077

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.