PDA

View Full Version : MS Access query


stickyb
14th Feb 2003, 06:38
I would be eternally thankful if someone comes up with a way to do this.

In Access, using a combo box on a form, is there a way to programmatically open the drop down list when the combo box gets the focus, without the user having to click on the little arrow at the side of the combo box?

What_does_this_button_do?
14th Feb 2003, 21:39
My answer: Use Oracle.

Opps.

(make note: I hate Access as much as the Inland Revenue).

Agent86
14th Feb 2003, 21:48
An easy one...

From design view
select the combo box you want to set this action to.

In the Properties select the Event tab and click in the
On Got Focus line.
Click on the Build button (the 3 dot button on the right of the line)
select Code builder

The VB code class module will open

Between these 2 lines

Private Sub Selectbase_GotFocus()

End Sub

add this code SendKeys "%{down}"


so you end up with


Private Sub Selectbase_GotFocus()
SendKeys "%{down}"
End Sub


Save your form

Now when you click or tab into the combo box the list will automatically display.

MAx

stickyb
15th Feb 2003, 07:10
Agent86, Thanks so much, I was well aware of event procedures, use them a lot, bur hadn't thought of send keys and there was nothing in the MS help stuff or examples. :ok:

WDTBD - don't be so grumpy old man, sometimes we are constrained by what we have to work with. :sad: