'Undo' Dropdown Method

T

Toys

I'm using the dropdown method to with the OnChange event to cause my combo
box to dropdown so that I can see records as I type. This works great. I
also have an AfterUpdate event that opens a form based upon the data of the
combo box. This also works 100%. However, I often use my mouse to select
the data I want when I can see it in the combo box. The problem I am having
is that bottom part of my combo box (the dropdown part) is now displayed over
my form. This obviously occurs because my record is changing and thus
triggering the OnChange event again. Is there any way to 'undo' the dropdown
method, or should I maybe use differenct evets to trigger the above actions?
Any help would be greatly appreciated.
 
T

Toys

That defeats the purpose. I want the combo box to dropdown when I begin
typing (so that I can see more detail, other columns in the combo box). The
onEnter event specifically drops down only when I've selected the record, and
it does not resolve the problem in any case. Thanks in any case. Any other
ideas?

There must be a way to pull up the dropdown box. For example (without
code), if you click the down arrow once, it dops down, another click brings
it up.
 
J

JK

I'm not sure if this is what you mean:

If you open the drop down and *not* wish to select anything (just have a
look), press the Escape key and the drop down will close

Reagrds/JK
 
T

Toys

Thanks, I'll try again. When I type in my combo box, the OnChange event
triggers the combo box to dropdown - perfect. This shows me 8 or so records.
As I type I get closer and closer to the record I want to select - perfect.
Often, I can see my record before I've fully typed the full word, for
example: I type "Joh" and I see: John1, John2, John3. Since I want John3,
I now click it - perfect, 100%. Clicking John3 open a filtered form for
John3 with all of his details - perfect, except the dropdown portion is over
my detail form!

The cause of the problem (I think): Clicking John3 triggers the OnChange
event (again??) and now displays the dropdown portion of the combo box
(John1, John2, John3, etc.) over the form with all of John3's details. The
form with the combo box (and the combo box itself) is hidden behind the
detail form, but not the dropdown part which I just forced open. Clicking
the form removes this dropdown, but it is an extra step that I don't want.

What I want: I just want my detail form not be under the dropdown box from
which I just selected the record I want.

Any ideas are greatly appreciated.
 
J

JK

Richard,

I managed to replicate your problem.
It seems that you are right, the on change event is triggred

The way I got out of it (i.e. close the drop down):

Private Sub YourCombo_LostFocus()

SendKeys "{Esc}", True

End Sub

Try it.

By the way if you want to increase the rows in the drop down in Properties
Sheet of the Combo change Row List to the number you want (it defaults to 8)

Regards/JK
 
T

Toys

It's Aaron btw, no worries. . .

As per your previous reply, I thought something like that might work, though
I haven't tested it. I wouldn't have known the syntax, i.e. the brackets in
any case. I appreciate you reply and the time you took to investigate the
issue. Also, I don't need to increase the amount of rows; I knew how to do
it in any event - thanks for the suggestion though.
 
J

JK

My pleasure, Aaron

Jacob

Toys said:
It's Aaron btw, no worries. . .

As per your previous reply, I thought something like that might work,
though
I haven't tested it. I wouldn't have known the syntax, i.e. the brackets
in
any case. I appreciate you reply and the time you took to investigate the
issue. Also, I don't need to increase the amount of rows; I knew how to
do
it in any event - thanks for the suggestion though.
 
T

Toys

Hi JK,

Actually, your suggestion didn't work. I tried putting code breaks all over
the show. It ran the code, but didn't stop the dropdown from displaying over
the form. Interesting enough, however, it never ran the OnChange event again
(after clicking the selection I wanted), which really confused me. But, not
to worry, I solved my own problem. I simply moved the dropdown code to the
KeyDown event. As neither a mouse click nor 'Enter' triggers this event, it
now works perfectly; opening my dropdown without it displaying over the new
form that I opened. Thanks for you help in any case.

Aaron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top