Converting Access DB to Access Project

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
..
 
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.
 
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.
 
Back
Top