Query Builder for Access

RELiNQUiSH

New member
Joined
Feb 18, 2011
Messages
1
Programming Experience
Beginner
Hello

Basically i've watched the Beth Massi video, on the video she uses the Query builder function to search 'FillByLastName'. The wildcard she uses is for SQL is [LIKE @LASTNAME '%'] but I want to use it for my Microsoft Access Database. I can't remember what to type in for Access can someone help me please.
 
It would actually have been [LIKE @LASTNAME + '%'] and I'm fairly sure that that should work for Access too. If not, try [LIKE @LASTNAME + '*']. Actually, thinking about it further, I don't think that the Query Builder supports parameter names with Access so you would have to use [LIKE ? + '%'] or [LIKE ? + '*'].
 
In an Access query you put the text you want inside of brackets in the criteria section of the query design grid and a prompt will show to the user when they run the query. Such as [Enter Customer Name]

If you want it to be a wild card then you have to sandwhich that between the star character like such...

"'*" & [Enter Customer Name] & "*'"

Because this is a string then I used tick marks before and after the wild card.
 
Back
Top