Jump to content
aberdeen-music
Sign in to follow this  
Ghostwriter

Help - ms access!

Recommended Posts

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 Null

I'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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites
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 Null

I'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

Would something like this work?


[Forms]![StaffBookSearch]![WhatAuthor] Like '*'

Share this post


Link to post
Share on other sites

Thanks for the suggestions. Turns out it was:

Like "*" & [Forms]![staffBookSearch]![WhatAuthor] & "*" Or [Forms]![staffBookSearch]![WhatAuthor] is Null

Anyway, finally got it finished and handed in. Thank God..

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...