Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto list opens for combo box once tabbed to 1

Status
Not open for further replies.

ski2sun

Technical User
Sep 12, 2001
31
0
0
US
Mike:

Question. How can I make a combo box open up automatically upon entering it to show me all the records in the list.

That is, suppose I am tabbing from a command button (lets say Cmd41) to combo box (say Combo 102). I would like to immediately see the 10 items that may appear in the list once I come upon combo box 102.

Is there something that needs to be activated in the properties of the combo box 102 or event properties. Can someone send sample. Help is appreciated. Thank you, E

 
check out the DROPDOWN method..

you could call it from the ON GOT FOCUS event of your combo:

Me!Combobox.Dropdown

 
Please help.......i tried this in response to 1st reply to my ?. It doesnt seem to help. I put the following in my Got Focus in event properties for the combo102 box

Me!Combo102.Dropdown

What must I do
 
Ski,

You can use the ListCount property with the ListRows property to specify how many rows you want to display in the list box portion of a combo box.

The following example uses the ListCount property to find the number of rows in the list box portion of the CustomerList combo box on a Customers form. It then sets the ListRows property to display a specified number of rows in the list.

Sub SizeCustomerList()
Dim ListControl As Control

Set ListControl = Forms!Customers!CustomerList
With ListControl
If .ListCount < 8 Then
.ListRows = .ListCount
Else
.ListRows = 8
End If
End With
End Sub

mac
 
Ski, don't put that DROPDOWN in the GotFocus of the combo, put it in the CLICK of the command button:
Code:
Sub Cmd41_Click()
 With ME 
   .Combo1.setfocus
   .combo1.Dropdown
 End with
End Sub




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top