combo Box

S

sandrao

How can I get a combo box to turn on when I enter a field and turn off when I
exit the field. I didn't the the appearance the the combo box to appear on
the form until it is needed.


Thank You
 
J

Jeff Boyce

I'm not exactly clear on what you are trying to do...

Are you asking to have a combobox enabled, or made visible, after the user
puts the focus in a separate control (your "field")?

You could add an [Event Procedure] to the GotFocus event of the separate
control that turns the enabled property or the visible property on/off.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

sandrao

Well, when I tab into the field that has the combobox I want the gray arrow
or button appear so that it can be clicked and select information the the
gray arrow disappear after I exit the field. I am not sure if has to be
enabled or made visible. probably the visible would suffice.

Do you have a code example in mind

Sandrao

Jeff Boyce said:
I'm not exactly clear on what you are trying to do...

Are you asking to have a combobox enabled, or made visible, after the user
puts the focus in a separate control (your "field")?

You could add an [Event Procedure] to the GotFocus event of the separate
control that turns the enabled property or the visible property on/off.

Regards

Jeff Boyce
Microsoft Office/Access MVP

sandrao said:
How can I get a combo box to turn on when I enter a field and turn off
when I
exit the field. I didn't the the appearance the the combo box to appear
on
the form until it is needed.


Thank You
 
J

Jeff Boyce

Something doesn't quite compute. If you are using a combo box as a control,
then you can't disable it (or make it invisible) and still be able to tab
into it.

A way to do something like what you are describing would be to lay a textbox
control on top of a combobox which you've made not visible. In the textbox
control, when the control gets the focus, you could add the Event Procedure
that: 1) makes the combo box visible, 2) sets the focus in the combobox,
and 3) makes the text box invisible.

If you want it to work a second time, you'd then have to add code to the
combobox's LostFocus event to reverse these changes.

That sounds like a lot of work just to make the drop-down arrow appear and
disappear!

Regards

Jeff Boyce
Microsoft Office/Access MVP


sandrao said:
Well, when I tab into the field that has the combobox I want the gray
arrow
or button appear so that it can be clicked and select information the the
gray arrow disappear after I exit the field. I am not sure if has to be
enabled or made visible. probably the visible would suffice.

Do you have a code example in mind

Sandrao

Jeff Boyce said:
I'm not exactly clear on what you are trying to do...

Are you asking to have a combobox enabled, or made visible, after the
user
puts the focus in a separate control (your "field")?

You could add an [Event Procedure] to the GotFocus event of the separate
control that turns the enabled property or the visible property on/off.

Regards

Jeff Boyce
Microsoft Office/Access MVP

sandrao said:
How can I get a combo box to turn on when I enter a field and turn off
when I
exit the field. I didn't the the appearance the the combo box to
appear
on
the form until it is needed.


Thank You
 
F

fredg

How can I get a combo box to turn on when I enter a field and turn off when I
exit the field. I didn't the the appearance the the combo box to appear on
the form until it is needed.

Thank You

Turn on? Do you mean for it to drop down and display the various
items?
Me!ComboName.Dropdown

Do you mean become visible on the form
Me!ComboName.Visible = True ' Or False when you wish to hide it.
 
V

Van T. Dinh

*Try* placing a Rectangle Control (about the same size with the drop-down
arror, no border, same colour as background colour of the Form) on to of the
drop-down arror and bring it to front.

When the ComboBox has the focus, it will be brought in front and the arror
should be visible. When the ComboBox doesn't have the focus, the Rectangle
will be in front covering the drop-down arror.

OTOH, I never bother with this in my databases.
 
L

Larry Linson

sandrao said:
Well, when I tab into the field that has the combobox
I want the gray arrow or button appear so that it can be
clicked and select information the the gray arrow
disappear after I exit the field. I am not sure if has to be
enabled or made visible. probably the visible would suffice.

My question would be, "Why? What are you trying to accomplish by doing
this?" The grey arrow button does not take up any significant space, it is
an integral part of the ComboBox, it distinguishes a ComboBox from a
TextBox, and few users find its visibility distracting when they are using
other controls -- thus, I do not understand why you'd want it invisible
until the Control is clicked or tabbed-into.

Larry Linson
Microsoft Access MVP
 
Top