-
search function
How would one go about setting up a 'search by keyword' type function? Basicly was thinking of a text box for what you want to look for, then click the button and it goes through row by row looking for that string in any position of any records 'name' field.
Any help from anyone?
-
If it is known columns it will be easy. if it should go through all the text columns in a table, then you have to have metadata information stored in a table and you can scroll through that for getting column information and then do a search on the table.
If it is sql server you can use Full text search.
-
yeah it will be in a specific column, and its not an sql server, its access...
-
say you have to search on 3 columns on a table. Say col1,col2 and col3 are columns.
select * from table where
col1 like '*xyz*' or
col2 like '*xyz*' or
col3 like '*xyz*'
-
ok...does that get exact matches or something? cus its not working at all...
I made a query and put on the project_name column that I wanted the ones that were LIKE forms!frmnamesearch.txtName and its comeing up blank....
am i dumb and misunderstanding you?
brandon
-
output the query that you are creating using msgbox or another text box and run the output in Access query.
you can copy and paste the query here.
Your query formation should be like below
Dim query As String
query = "select * from table where col1 like '*" & Me!Text0 & "' or col2 = '*" & Me!Text0 & "'"
msgbox query
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|