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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing the drop-down arrow on a combo box

Status
Not open for further replies.

ind

Programmer
Mar 9, 2000
121
US
How do I remove the drop-down arrow on a combo box, so it will look like a text box????????
 
Yes I want it to behave like a combo box
 
I want to use a command button instead of the drop-down arrow to expand the combo box.
 
The Arrow in a combo box gets there from a .DLL call to some file we don't know about.<br>
So NO you can't get rid of it.<br>
Unless you Know &quot;C&quot; language and you want to design your own .OCX.<br>
Now to drop down a combo box requires an API call.<br>
I have on but it does not work in Access just Visual Basic Pro<br>
But here it is if you want to fiddle with it.<br>
the first line goes in a Module<br>
---------------------------------------------<br>
Declare Function SendMessage Lib &quot;user32&quot; Alias &quot;SendMessageA&quot; (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Long) As Long<br>
---------------------------------------------<br>
Private Sub Combo1_GotFocus ()<br>
Const CB_SHOWDROPDOWN = &H14F<br>
Dim Tmp<br>
Tmp = SendMessage(Combo1.hWnd, CB_SHOWDROPDOWN, 1, ByVal 0&)<br>
End Sub<br>
<br>
the second lines go in some event in Access Of course there is no &quot;Combo1_GotFocus&quot; event in Access <br>
<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
Use a rectangle to cover the dropdown arrow. Fill the rectangle and set the border to the same color as the form. This will give the appearance that there is no dropdown arrow.<br>
<br>
HTH<br>
RDH <p>Ricky Hicks<br><a href=mailto: rdhicks@mindspring.com> rdhicks@mindspring.com</a><br><a href= > </a><br>
 
Just another thought, in case you didn't know.<br>
To get the dropdown of the combo box using a button, use the follwing code:<br>
<br>
Private Sub cmdDropDown_Click()<br>
DoCmd.GoToControl &quot;YourCombo&quot;<br>
YourCombo.Dropdown<br>
End Sub<br>
<br>
Of course &quot;YourCombo&quot; needs to be the actual name of your combo box.<br>
<br>
Good Luck,<br>
RDH <p>Ricky Hicks<br><a href=mailto: rdhicks@mindspring.com> rdhicks@mindspring.com</a><br><a href= > </a><br>
 
Yes it will achieve the same results, so I guess you could use control.SetFocus in place of the DoCmd.GoToControl. The main point is that the combobox must have focus before the control.Dropdown code.<br>
<br>
RDH <p>Ricky Hicks<br><a href=mailto: rdhicks@mindspring.com> rdhicks@mindspring.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top