|
|
#1 |
|
New Member
Join Date: Jun 07
Posts: 3
![]() |
Newbie Help: Query Builder
I'm in a hurry so I'm sorry if I overlooked something obvious.
I haven't coded in Visual Basic for well over 5 years so I'm very rusty and I need to create a database frontend that allows a user to see a table in a .mdb and also search through the columns. So I do the following: 1)New Project and add the mdb and table as a data source. 2)Drag the table into the form and use the query builder to create a search for the Title Column by adding (WHERE Title=?) or (WHERE Title like ?) However when I use the search query, it'll only show results that match exactly whats in the search box. I need it to display similiar results as well. eg: If I type in Harry Potter, I need it to show three different Harry Potter Titles. If I type in Tolkien I need it to show results for JRR Tolkien as well. How do I set this up? It's probably something obvious but like I said I was in a hurry so I possibly overlooked it. |
|
|
|
|
|
#2 |
|
Frenzied Member
Join Date: Jun 07
Location: Colorado, U.S.A.
Posts: 1,672
![]() ![]() ![]() |
Re: Newbie Help: Query Builder
Hi Dag,
You can use wildcard characters. For example: %Potter% will match "Potter" anywhere in the title. Read a lot more about them here: http://office.microsoft.com/en-us/ac...881851033.aspx Good luck |
|
|
|
|
|
#3 |
|
New Member
Join Date: Jun 07
Posts: 3
![]() |
Re: Newbie Help: Query Builder
How would i go about making sure that the % sign is automatically added before and after the text to search for?
|
|
|
|
|
|
#4 |
|
Frenzied Member
Join Date: Jun 07
Location: Colorado, U.S.A.
Posts: 1,672
![]() ![]() ![]() |
Re: Newbie Help: Query Builder
Something like this:
(WHERE Title Like '%' + ? + '%') |
|
|
|
|
|
#5 |
|
New Member
Join Date: Jun 07
Posts: 3
![]() |
Re: Newbie Help: Query Builder
Oh man, thank you so so much! That worked perfectly.
Damn, i feel like an idiot for not trying that...but anyway, thanks. My project is finally done. |
|
|
|
|
|
#6 |
|
Frenzied Member
Join Date: Jun 07
Location: Colorado, U.S.A.
Posts: 1,672
![]() ![]() ![]() |
Re: Newbie Help: Query Builder
Glad to help.
|
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|