Combo box - Record Find - Start Typing - Results Pop Up

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

Guest

I have created a find record combo. You can click on the arrow to have the
results pop up or show the list. How do you get it to automatically do this
when you start typing in the box instead of manually having to click on it?
That way you can see results as you start to type, but more than just one...

Thanks
Curtis
 
If you want a character-by-character response, you would need to use the
Change event of the combo to set the RowSource of the list box.

This example assumes a combo named Combo1, with a Bound Column that is a
field of type Text, and a list box named List1 that shows the results from
Field1 of Table1:

Private Sub Combo1_Change()
Dim strSql As String
If IsNull(Me.Combo1) Then
strSql = "SELECT Field1 From Table1;"
Else
strSql = "SELECT Field1 From Table1 " & _
"WHERE Field1 Like """ & Me.Combo1.Text & "*"";"
End If
Me.List1.RowSource = strSql
End Sub
 
I more so simply want the box to pop up instead of having to manually
clicking on teh pull down.
 
If you want the Find box to pop up so you can search, you could do that with
a command button that has this code in its Click event procedure:
RunCommand acCmdFind

It won't respond to each character though.
 
The picture suggests you just want the combo to drop-down as soon as you
enter it?

In the Enter event procedure of the combo of the combo:
Me.[Combo1].DropDown

Replace Combo1 with the name of your combo.
 
I just now saw this post, wasn't notified. AWESOME!!!

I put this in the on key press event. Something I can enter to make the
list go away when I use the TAB key? It does when I use enter, but not tab...

Curtis

In the Enter event procedure of the combo of the combo:
Me.[Combo1].DropDown

Replace Combo1 with the name of your combo.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Curtis Stevens said:
This is what I'm wanting, go here for visual aid:

http://www.gotmerchant.com/pulld.gif

Now is that possible?
 
It should work with tab also.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Curtis Stevens said:
I just now saw this post, wasn't notified. AWESOME!!!

I put this in the on key press event. Something I can enter to make the
list go away when I use the TAB key? It does when I use enter, but not
tab...

Curtis

In the Enter event procedure of the combo of the combo:
Me.[Combo1].DropDown

Replace Combo1 with the name of your combo.

message
This is what I'm wanting, go here for visual aid:

http://www.gotmerchant.com/pulld.gif

Now is that possible?
 
Ok, I put it in On enter, it doesn't work.
I put it in on key press and I thought it went away on enter, but it doesn't
either, assuming you are choosing a different record that it is currently on
each time.

So what I have tested:

On enter - no work
On key press - works, but doesn't go away unless you click somewhere else.
On key up - no work

Curtis

It should work with tab also.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Curtis Stevens said:
I just now saw this post, wasn't notified. AWESOME!!!

I put this in the on key press event. Something I can enter to make the
list go away when I use the TAB key? It does when I use enter, but not
tab...

Curtis

In the Enter event procedure of the combo of the combo:
Me.[Combo1].DropDown

Replace Combo1 with the name of your combo.

message
This is what I'm wanting, go here for visual aid:

http://www.gotmerchant.com/pulld.gif

Now is that possible?
 
Reviewing this thread, I'm rather confused as to what you want.

The Enter event fires when you enter the combo, not when you press Enter.
(It is not connected to the Enter key at all.) This is the event to use if
you want to DropDown the combo.

The Change event happens after every keystroke. This is the event to use if
you want to alter the form's Filter after every keystroke, though this is
rather messy to do. For example, you are in trouble if this combo's
LimitToList is Yes (as it must be if its bound column is zero-width), since
the NotInList event will fire and mess things up.

The KeyPress or KeyUp events have no relevence that I can follow here.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Curtis Stevens said:
Ok, I put it in On enter, it doesn't work.
I put it in on key press and I thought it went away on enter, but it
doesn't
either, assuming you are choosing a different record that it is currently
on
each time.

So what I have tested:

On enter - no work
On key press - works, but doesn't go away unless you click somewhere else.
On key up - no work

Curtis

It should work with tab also.

message
I just now saw this post, wasn't notified. AWESOME!!!

I put this in the on key press event. Something I can enter to make
the
list go away when I use the TAB key? It does when I use enter, but not
tab...

Curtis


In the Enter event procedure of the combo of the combo:
Me.[Combo1].DropDown

Replace Combo1 with the name of your combo.

message
This is what I'm wanting, go here for visual aid:

http://www.gotmerchant.com/pulld.gif

Now is that possible?
 
When I enter this code - Me.SearchFor.Dropdown into the on enter event, it
doesn't work, the pull down doesn't pop up.

The only one I see that will work, is on key press, but it doesn't go away
when you hit tab or enter key, you must click somewhere on the forum.

Make sense?

The Enter event fires when you enter the combo, not when you press Enter.
(It is not connected to the Enter key at all.) This is the event to use if
you want to DropDown the combo.

The Change event happens after every keystroke. This is the event to use if
you want to alter the form's Filter after every keystroke, though this is
rather messy to do. For example, you are in trouble if this combo's
LimitToList is Yes (as it must be if its bound column is zero-width), since
the NotInList event will fire and mess things up.

The KeyPress or KeyUp events have no relevence that I can follow here.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Curtis Stevens said:
Ok, I put it in On enter, it doesn't work.
I put it in on key press and I thought it went away on enter, but it
doesn't
either, assuming you are choosing a different record that it is currently
on
each time.

So what I have tested:

On enter - no work
On key press - works, but doesn't go away unless you click somewhere else.
On key up - no work

Curtis

It should work with tab also.

message
I just now saw this post, wasn't notified. AWESOME!!!

I put this in the on key press event. Something I can enter to make
the
list go away when I use the TAB key? It does when I use enter, but not
tab...

Curtis


In the Enter event procedure of the combo of the combo:
Me.[Combo1].DropDown

Replace Combo1 with the name of your combo.

message
This is what I'm wanting, go here for visual aid:

http://www.gotmerchant.com/pulld.gif

Now is that possible?
 
Curtis, I just tested it again here, and the Dropdown code works fine for me
in the Enter event of the combo.

I have to assume that you have some other factor in play here that is making
the difference in your case. Perhaps another event, such as a timer, or a
forced requery or something.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Curtis Stevens said:
When I enter this code - Me.SearchFor.Dropdown into the on enter event, it
doesn't work, the pull down doesn't pop up.

The only one I see that will work, is on key press, but it doesn't go away
when you hit tab or enter key, you must click somewhere on the forum.

Make sense?

The Enter event fires when you enter the combo, not when you press Enter.
(It is not connected to the Enter key at all.) This is the event to use
if
you want to DropDown the combo.

The Change event happens after every keystroke. This is the event to use
if
you want to alter the form's Filter after every keystroke, though this is
rather messy to do. For example, you are in trouble if this combo's
LimitToList is Yes (as it must be if its bound column is zero-width),
since
the NotInList event will fire and mess things up.

The KeyPress or KeyUp events have no relevence that I can follow here.

message
Ok, I put it in On enter, it doesn't work.
I put it in on key press and I thought it went away on enter, but it
doesn't
either, assuming you are choosing a different record that it is
currently
on
each time.

So what I have tested:

On enter - no work
On key press - works, but doesn't go away unless you click somewhere
else.
On key up - no work

Curtis


It should work with tab also.

message
I just now saw this post, wasn't notified. AWESOME!!!

I put this in the on key press event. Something I can enter to make
the
list go away when I use the TAB key? It does when I use enter, but
not
tab...

Curtis


In the Enter event procedure of the combo of the combo:
Me.[Combo1].DropDown

Replace Combo1 with the name of your combo.

message
This is what I'm wanting, go here for visual aid:

http://www.gotmerchant.com/pulld.gif

Now is that possible?
 
Back
Top