Converting Access DB to Access Project

G

Guest

I have converted my Access db to an Access Project. All is well except one
search query. In Access, my criteria is:

Like "*" & [Forms]![frmAllSearch]![txtWhatBook] & "*"

I have the same form in my ADP, but when I copy and paste this into my
Stored proc criteria it converts as

LIKE N'[*] & [Forms]![frmAllSearch]![txtWhatBook] & [*]'

but it doesn't return results.

Can anyone tell me how to convert this please?

Thanks.
 
J

John Spencer

Try using the % and _ for the wild cards instead of * and ?

LIKE '%' & [Forms]![frmAllSearch]![txtWhatBook] & '%'

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Guest

No, that didn't work. Even if I don't use the "like", so criteria would be
=[forms]![frmAllSearch]![txtWhatBook], that doesn't work. It works perfectly
in my mdb, but not in my adp.

My form is obviously a search form, user enters part of the book title and
the query returns a list of books.

John Spencer said:
Try using the % and _ for the wild cards instead of * and ?

LIKE '%' & [Forms]![frmAllSearch]![txtWhatBook] & '%'

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Kathy said:
I have converted my Access db to an Access Project. All is well except one
search query. In Access, my criteria is:

Like "*" & [Forms]![frmAllSearch]![txtWhatBook] & "*"

I have the same form in my ADP, but when I copy and paste this into my
Stored proc criteria it converts as

LIKE N'[*] & [Forms]![frmAllSearch]![txtWhatBook] & [*]'

but it doesn't return results.

Can anyone tell me how to convert this please?

Thanks.
 
J

John Spencer

I'm stuck. I don't work with ADPs all that much, so perhaps someone else
can pick up the thread. I do suggest that you post the entire SQL
statement. That might give someone a clue as to the problem. Also, have
you just run the query by itself with to see if it works.

Instead of using the reference to the form control just enter the value you
are searching for in the query and see if it returns a result?



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Kathy said:
No, that didn't work. Even if I don't use the "like", so criteria would be
=[forms]![frmAllSearch]![txtWhatBook], that doesn't work. It works
perfectly
in my mdb, but not in my adp.

My form is obviously a search form, user enters part of the book title and
the query returns a list of books.

John Spencer said:
Try using the % and _ for the wild cards instead of * and ?

LIKE '%' & [Forms]![frmAllSearch]![txtWhatBook] & '%'

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Kathy said:
I have converted my Access db to an Access Project. All is well except
one
search query. In Access, my criteria is:

Like "*" & [Forms]![frmAllSearch]![txtWhatBook] & "*"

I have the same form in my ADP, but when I copy and paste this into my
Stored proc criteria it converts as

LIKE N'[*] & [Forms]![frmAllSearch]![txtWhatBook] & [*]'

but it doesn't return results.

Can anyone tell me how to convert this please?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top