Open DropDown On Entry...

MainForm / Subform... SubForm is displayed in a tab control. When the tab is selected I want the dropdown to be open. I can't get this to work. The most recent suggestion that I have been given is:
    Me![sbfFundReturnsNetListing].Form![FundNameCombo].SetFocus
    SendKeys "{F4}"

This doesn't seem to be working either. This was placed in the onclick of the tab and the onload of the main form.
ronallardAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

brewdogCommented:
Well, I just tried this:

    Me!sbfFundReturnsNetListing.Form!FundNameCombo.SetFocus
    Me!sbfFundReturnsNetListing.Form!FundNameCombo.Dropdown

and it seems to work, though I couldn't duplicate your situation exactly. Let me know what happens . . .

brewdog
0
fedsunsCommented:
Ron,
      The click event for the tab control doesn't fire when you click on a tab that has a name so maybe your code didn't get executed? Anyway what I did was to put your set focus statement in the tab change event and then
in the got focus event for the combo box fundNameCombo inserted this code:
Me.FundNameCombo.Dropdown. Hope this helps please let me know how it all worked out
John Smith
0
ronallardAuthor Commented:
brewdog:
That is how I normally do it. But I am usually not dealing with sub-forms on pages within a tab control.

fedsuns:
I put this in the on change for the tab control:
Private Sub TabCtl0_Change()
    Me![sbfFundReturnsNetListing].Form![FundNameCombo].SetFocus
End Sub
(this code does get executed)


Then I put this in the got focus of the combo-box in the sub-form:
Private Sub FundNameCombo_GotFocus()
    Me![FundNameCombo].Dropdown
End Sub
(I put a stop in here and it never gets taken - even when I click in the  combo-box????!!)

Still not working??

Remember, MainForm has a tab control on it. On tab-6 there is a sub-form. The combo-box is actually on the sub-form.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

brewdogCommented:
Hmm, mine worked, but I attached it to form_load, not a tab form's change event. I'll test that piece tomorrow morning if this isn't solved yet.
0
fedsunsCommented:
Ron,
Sorry on mine it worked the first time and I quit. BAsically if the combo box all ready has focus for some reason (i.e. it is the first control in the tab order) when the set focus is executed then the got focus doesn't execute. Try this on the tab   change event:
Private Sub TabCtl0_Change()
    Me![sbfFundReturnsNetListing].Form![FundNameCombo].SetFocus
    Me![sbfFundReturnsNetListing].Form![FundNameCombo].Dropdown
End Sub
It works on my machine.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brewdogCommented:
any news here, ronallard? I have never gotten back to this issue. If you still want me to look into it further, let me know . . .
0
ronallardAuthor Commented:
Sorry - I've been very sick and haven't worked on this. Just got back to work today... Still would like an answer...
0
brewdogCommented:
I'll see if I can scrounge a few minutes later today or tomorrow morning . . .
0
fedsunsCommented:
Ronallard,
    Sorry you've been sick. Did the code I suggested work? If it didn't or there is a better solution please let me know. thanks
John Smith
0
brewdogCommented:
ronallard:

Hmm . . . I think I just duplicated your situation, and it works fine for me. Here's what I put on the Change event of my Tab Control:

    If TabCtl9.Value = 0 Then
        Me!fsubtblCheeze2.Form!cboCheeze.SetFocus
        Me!fsubtblCheeze2.Form!cboCheeze.Dropdown
    End If

where 0 is the first page in the tab control, fsubtblCheeze2 is the name of the subform control, and cboCheeze is the combo box.
0
ronallardAuthor Commented:
My appologies to all of you for letting this run out sooooo long. With family illnesses and deadlines at work I just haven't had a chance to follow up.

John, you solution worked just fine. It even works when just clicking on the tabs and not following the programmed progression.

Thanks again to all for you patients!
0
fedsunsCommented:
Your welcome and good luck
John
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.