Search multiple fields in one textfield in Continuous form (1 Viewer)

Moore71

DEVELOPER
Local time
Today, 13:18
Joined
Jul 14, 2012
Messages
158
Hi,
how can i design a textbox or combo to search for multiple fields from another table

Thanks in advance
 

Ranman256

Well-known member
Local time
Today, 08:18
Joined
Apr 9, 2015
Messages
4,337
1 you shouldnt need to search multiple fields...if you do then your table is designed wrong. Normally you search in 1 field...like [person] for name. you search in the 1 field, for 'John', and not need to look in [address] and [city] for his name.

2. you should have a form bound to the table you want to search in, and a text box to put the search criteria. then afterupdate, filter the data, in the table using:

Code:
swhere = "[name] like "*" & txtBox & "*"
swhere = or "[address] like "*" & txtBox & "*"
swhere = or "[city] like "*" & txtBox & "*"

  'apply the filter

    me.filter = sWhere
    me.filterOn = true
End If
 

mjdemaris

Working on it...
Local time
Today, 05:18
Joined
Jul 9, 2015
Messages
426
@Ranman:
I disagree with not searching multiple fields. I've created a database that allows the users to search four fields at once. I've done this to keep it simple for those who are not query/search/filter savvy.

This is a parts inventory database, and the fields they need to be able to search for are:
Internal Part Number, Description, Vendor Part Number, and Vendor Barcode.

I've done this with a single text box.

Also, here http://www.access-programmers.co.uk/forums/showthread.php?t=188663 is another way to do it.

Mike
 

Users who are viewing this thread

Top Bottom