Combo Box Arrow/Functionality

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Real Estate is at a premium on my continous form. What I need to do is have
the user type into a field and have the field autofill like a combo box that
does a table lookup.

However, I cannot have the drop-down arrows associated with a combo box,
since they hide the data, and I have no more room to expand the field sizes
on the form.

Any ideas???
 
MSROOKIE said:
Real Estate is at a premium on my continous form. What I need to do
is have the user type into a field and have the field autofill like a
combo box that does a table lookup.

However, I cannot have the drop-down arrows associated with a combo
box, since they hide the data, and I have no more room to expand the
field sizes on the form.

Any ideas???

Have two controls bound to the same field, one a TextBox and one a ComboBox.
Size and postion the controls such that the TextBox is laid on top of the
ComboBox completely obscuring it. Then in the GotFocus event of the TextBox run
a single line of code that sets focus to the ComboBox. Set the TabStop property
of the ComboBox to No so that the only way it will get focus is by way of the
aforementioned code.

Whenever the user tabs into or clicks on the TextBox they will immediatley see
the arrow and get the "search as you type" behavior, but as soon as they are
done and tab out of the ComboBox the arrow will vanish as the TextBox moves back
to the front.
 
Thanks for the help. This worked great. One behavior I noted though was
when the combo-box gets focus, the tabs don't work (as expected with no tab
stop), and only the left key will move out of the field. Why only the left
key, and not the other keys???

Thanks..
 
MSROOKIE said:
Thanks for the help. This worked great. One behavior I noted though
was when the combo-box gets focus, the tabs don't work (as expected
with no tab stop), and only the left key will move out of the field.
Why only the left key, and not the other keys???

Not sure what you mean. The TabStop = No prevents the Tab key from taking
you TO that control. It has no affect on tabbing AWAY from it (that I am
aware of).
 
Apparently the non-combo box gets focus when the tab key is presses, setting
up a loop.

I put a msgbox in the "on focus" event of the non-combo box control, it it
appears it is invoked after a tab from the text box.

So it looks like the order is: Tab to the text box, on focus event sets
focus to hidden combo box, tab from hidden combo box, on focus event of text
box executed (now we are in a loop).

It does not seem that adjusting the tab order or if the hidden combo boxes
setting of tab stop seems to effect the form giving focus to the text box.

Any ideas???
 
First -
Does anyone know if the MVP's have some type of trigger for follow-ups? I
have posted several the follow-up questions including the one below as a
reply, but it seems to fall off the radar screen.

Second -
To resolve this problem, I changed the tab order to have the hidden combo
after the unhidden one. It appears that even if the tab stop is set to no,
somehow the hidden box gets focus when you tab from the field, setting up a
loop.

Hope this helps folks for future searches in the newsgroup!
 
MVPs access the newsgroups in the same ways as everyone else. No special
tools or facilities. Please remember that MVPs, and others who answer
questions in these newsgroups, do so voluntarily. Everyone has the right to
choose to which posts they wish to respond - or not, as the case may be.
 
Back
Top