Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form filter to show multiple records

Status
Not open for further replies.

dcorleto

MIS
May 19, 2002
82
0
0
US
I have a table with a field called LOCATION.

I would like to make a form where a user could input a location and click search, and all the records in that location would show up.

Can someone please give me a hint to jump start.

Thank you so much.


dc
 
There is more than one way to do this. I will show you one.

1) Create a text box called txtSearch
2) Add a button called cmdSearch
3) Add another button called cmdUndoSearch
4) Put this in the click event of each button...
Code:
Private Sub cmdSearch_Click()
    Me.Filter = "CustomerID = " & txtSearch
    Me.FilterOn = True
End Sub

Private Sub cmdUndoSearch_Click()
    Me.FilterOn = False
End Sub
5) Put something in txtSearch and click the search button.

Hope this gets you started.

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Works great. But what I need to be able to do is show all the records in that location. For example, if I have a location 03-42, I would like to be able to enter that location in the search box, and have it display the group of records that are associated with that location. For instance:

Location 03-42

CPU 8183
Monitor 545222
Printer HP4500

I imagine this is possible, but don't have a clue how to do it.

 
Are you saying 03 through 42 or is 03-42 a single string like "03-42"?

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
How are ya dcorleto . . .

It appears the code given [blue]LonnieJohnson[/blue] need a slight modification:
Code:
[blue]    Me.Filter = "[purple][b][Location][/b][/purple] = '" & txtSearch & "'"[/blue]

Calvin.gif
See Ya! . . . . . .
 
03-42 is one location

Here is a sample list of 7 distinct locations

03-42
03-43A
03-43B
04-02
04-012A
04-12B
04-12V

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top