Can you disable combo box arrows? If not, any other ideas for my case?

piggitypow

Registered User.
Local time
Today, 15:02
Joined
Mar 19, 2005
Messages
19
I would like to have a combo box that doesn't show the drop-down arrow when the user selects it. You say, doesn't that defeat the purpose of the combo box?

Well, look. In a form I have a datasheet (in a subform) that only displays data, so it is locked from editing. Within the datasheet is a field that contains a combo box with a row source from a linked table, and the control source of that combo box is the primary key. Essentially I'm utilizing the combo box because it is smart, and allows me to display linked data: this combo box contains two columns, and I set the first column's width to "0" so that it would only display the field I want. I didn't use a subform because, in datasheet view, subform fields are not displayed in the linear fashion I need, but instead go hide under the "+" button for each record.

So, even though everything is locked from editing, the combo box arrow still appears when the user clicks on the combo box field, and I don't want it to. It's just misleading to the user. Anyone know how to disable the arrows? Or, if you catch my drift, do you know of another simple solution?

I'm not a keen programmer in case you couldn't figure that out. If you've got any VB tips then let me know.
 
Perhaps a list box? I have used them as a cheap substitute for a subform or dlookup.
 
Listoboxes have arrows too so same problem.
 
I'm not exactly sure how to do it... I can only think of a workaround which I've included in the attachment.

It is based on the width of the scrollbar button. This being said it is important to note that each version of windows has their own default for scrollbar width. I'm sure you could go into the registry and find what the current width is... but I am too tired to do this :) Maybe if you reallly want it i'll do it laters.

Needless to say, the only way to escape the drop down (if there isn't a command for it) is to set the focus to something else.


I hope this helps at least somewhat.
 

Attachments

Cover it with a rectangle that matches your background.
 
piggitypow said:
Listoboxes have arrows too so same problem.
Brain fart. I only use these to provide information, so disabled and locked. (the scroll buttons don't appear until you enter the listbox.)
But like you said, your subform only displays information...so why can't you use a listbox? Or use a text box and a query for your subform?
 
No, you can't hide the dropdown icon of a combobox in Access.
What you have described, regarding the subform, can be gotten around by bringing the second field (as bound to the combobox) into the query bound to the subform and just using that.
 
There many ways to do other workarounds as SJ describes, I figured you still wanted to use the combo box for some reason.

You could just have a hidden combo box and use a textbox who's value = combobox.itemdata(0) on a form's load. That's why hidden is such a special property. Programmer can use it and user can't see it =)
 

Users who are viewing this thread

Back
Top Bottom