Ghostwriter Posted October 29, 2008 Report Share Posted October 29, 2008 Hey,I have to do a stupid coursework project for uni. It's a database in MS Access that is supposed to be based on a bookshop. My problem is this: i've created a form that runs a search on the tables by using a query. The criteria line I'm using in the query is: [Forms]![staffBookSearch]![WhatAuthor] Or [Forms]![staffBookSearch]![WhatAuthor] is NullI'm now trying to add a wildcard so that if, when searching, the DB user only knows part of an author's name, all the search results will still appear.Can someone please help? I can't seem to get "*" to work.. and i've looked at so many online help forums.. and can't find anything to work.Thanks Quote Link to comment Share on other sites More sharing options...
Chris Posted October 30, 2008 Report Share Posted October 30, 2008 Can you post the full SQL query?I dunno what all that square brackets stuff is but I assume it's generated by the query builder, if you can post what's in the SQL view that'd be better.Failing that try % instead of *, though * should work in Access.At this point I'd probably say the Uni shouldn't be teaching Access anyway but then I remember that I've had to look at problems with 2 or 3 Access database in the last month at work. Quote Link to comment Share on other sites More sharing options...
mcsheepie Posted October 30, 2008 Report Share Posted October 30, 2008 If you're doing the search in code try using "" (you can also use ' but if the search field has an apostrophe in it it doesn't work, the double quotation marks will work - but it can get quite confusing to write) Quote Link to comment Share on other sites More sharing options...
Neil Posted October 30, 2008 Report Share Posted October 30, 2008 Hey,I have to do a stupid coursework project for uni. It's a database in MS Access that is supposed to be based on a bookshop. My problem is this: i've created a form that runs a search on the tables by using a query. The criteria line I'm using in the query is: [Forms]![staffBookSearch]![WhatAuthor] Or [Forms]![staffBookSearch]![WhatAuthor] is NullI'm now trying to add a wildcard so that if, when searching, the DB user only knows part of an author's name, all the search results will still appear.Can someone please help? I can't seem to get "*" to work.. and i've looked at so many online help forums.. and can't find anything to work.ThanksWould something like this work?[Forms]![StaffBookSearch]![WhatAuthor] Like '*' Quote Link to comment Share on other sites More sharing options...
Ghostwriter Posted November 9, 2008 Author Report Share Posted November 9, 2008 Thanks for the suggestions. Turns out it was:Like "*" & [Forms]![staffBookSearch]![WhatAuthor] & "*" Or [Forms]![staffBookSearch]![WhatAuthor] is NullAnyway, finally got it finished and handed in. Thank God.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.