|
-
Jun 22nd, 2007, 01:00 PM
#1
Thread Starter
New Member
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.
-
Jun 22nd, 2007, 01:15 PM
#2
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
-
Jun 22nd, 2007, 01:38 PM
#3
Thread Starter
New Member
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?
-
Jun 22nd, 2007, 01:45 PM
#4
Re: Newbie Help: Query Builder
Something like this:
(WHERE Title Like '%' + ? + '%')
-
Jun 22nd, 2007, 01:51 PM
#5
Thread Starter
New Member
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.
-
Jun 22nd, 2007, 01:55 PM
#6
Re: Newbie Help: Query Builder
Glad to help.
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
|
Click Here to Expand Forum to Full Width
|