Combo box - dropdown not dropping down

iampaul

Registered User.
Local time
Today, 22:26
Joined
Apr 19, 2005
Messages
14
On selecting a certain value in a combo box, I would like to re-populate the combo box with a different set of values (different SQL record source) and make it automatically drop down.

It all works fine except for droppign down again. I believe it is to do with the fact that the combo box was already dropped down.

I have tried the following, any ofther ideas?



With ctlCombo
.RowSource = ""
ctlCombo = Null
.Requery
.RowSource = strSQL
.ListRows = lngRecordCount
.ColumnCount = 2
.ColumnWidths = "0;5000"
.Visible = True
.Requery
.SetFocus
.Dropdown
End With
 
I think you're right. I think you need to set the focus on another control then run your code, then the focus will come back to your combobox and it'll work as you want it to.
 
The code or keyboard shortcut for dropping down a combobox is F4.
so perhaps this might help:
Code:
sendkeys {F4}
 
Last edited:
Thanks

Switching the focus did not work for some reason, but the send keys statement does.

For anyone else reading this, the syntax I used is:

SendKeys "{F4}"
 

Users who are viewing this thread

Back
Top Bottom