As I enter Search Name Show Results? (1 Viewer)

THREE05

Registered User.
Local time
Today, 08:59
Joined
Dec 29, 2015
Messages
30
Hello World:
I been creating a database for My office that contains Hundreds of records every Month.. I have an outbound text box with a search button. But I want to set up a code that shows me the filtered record as I type the search text...

Example if I type R to start showing all R's and fort as I type in.???

Tanks in advance my good friends.....
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:59
Joined
May 7, 2009
Messages
19,247
be warned that it could be slow on hundred of records, since everytime you press a keystroke a code to filter your data is run.

you can do it in your textbox control's Change event:

Private Sub textbox1_Change()
Dim strText As String
strText = Me!textbox1.Text & ""
If strText = "" Then
Me.FilterOn = False
Else
Me.Filter = "[fieldtoFilter] Like '*" & strText & "*'"
If (Not Me.FilterOn) Then Me.FilterOn = True
End If
End Sub
 
Last edited:

Wiz47

Learning by inches ...
Local time
Today, 11:59
Joined
Nov 30, 2006
Messages
274
Hello World:
I been creating a database for My office that contains Hundreds of records every Month.. I have an outbound text box with a search button. But I want to set up a code that shows me the filtered record as I type the search text...

Example if I type R to start showing all R's and fort as I type in.???

Tanks in advance my good friends.....

Here's a program that I found, then greatly expanded on years ago. It might be what you need. I use it as my personal Rolodex. With it, you can search in real time in any field. So, it's just not limited to the name. For example, if you have a phone number, but no name to go with it, just start typing in the number and it will start to show results in the list.

Double click and it will bring up the full record for that person. Double click in the e-mail box and it will open up Outlook and address an e-mail to them.

Very cool little program, actually. I'm pretty proud of what it can do.

Hope it helps.
 

Attachments

  • MyRolodex - Copy.mdb
    416 KB · Views: 72

THREE05

Registered User.
Local time
Today, 08:59
Joined
Dec 29, 2015
Messages
30
Here's a program that I found, then greatly expanded on years ago. It might be what you need. I use it as my personal Rolodex. With it, you can search in real time in any field. So, it's just not limited to the name. For example, if you have a phone number, but no name to go with it, just start typing in the number and it will start to show results in the list.

Double click and it will bring up the full record for that person. Double click in the e-mail box and it will open up Outlook and address an e-mail to them.

Very cool little program, actually. I'm pretty proud of what it can do.

Hope it helps.

Hey Buddy!
Thank you very much for your help. I will definitively give it a try. God bless you and have a nice day....
 

THREE05

Registered User.
Local time
Today, 08:59
Joined
Dec 29, 2015
Messages
30
be warned that it could be slow on hundred of records, since everytime you press a keystroke a code to filter your data is run.

you can do it in your textbox control's Change event:

Private Sub textbox1_Change()
Me.Filter = "[fieldtoFilter] Like *" & Me!textbox1.Text & "*"
Me.FilterOn = True
End Sub

Buddy thanks A Lot for your help and advice. I definitively code it and see what happens.. God bless you and have a nice day...
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:59
Joined
May 7, 2009
Messages
19,247
you can also change your recordsource on the fly (unfiltered), therefore you can filter further:

Private Sub textbox1_Change()
Dim strText As String
strText = Me!textbox1.Text & ""
If strText = "" Then
Me.RecordSource = "Select * From table1;"
Else
Me.RecordSource = "Select & From table1 Where [fieldtoFilter] Like '*" & strText & "*'"
End If
End Sub
 

Users who are viewing this thread

Top Bottom