reverse of dropdown

  • Thread starter Thread starter Song
  • Start date Start date
S

Song

I have following code to drop down

Private Sub cboFindName_Enter()
Me!cboFindName.BackColor = -2147483643
Me!cboFindName.Dropdown
End Sub

After find the name, I want focus to stay in cboFindName. However, it stays
in dropdown state. What code to make it NOT to drop down after I find the
record?
 
I cannot as my form has several tabs and cboFindName is in form header. I do
not know which tab users is on. I prefer the focus stays in cboFindName
which is in form header. Is there anyway to do it? Thanks.
 
To add to Doug's correct statement, you could add a very small textbox
(height and width both set to 0) in the form's header, set its Tab Stop
property to No, and then use that to set focus to and back again.
 
I cannot as my form has several tabs and cboFindName is in form header. I do
not know which tab users is on. I prefer the focus stays in cboFindName
which is in form header. Is there anyway to do it? Thanks.

Leave your code in the Enter event.

If you have code in the combo box AfterUpdate event (to find a
record), as the last 2 lines of code add:

Me.cboFindName.SetFocus
SendKeys "{F4}"
 
Back
Top