Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UCase not recognised 1

Status
Not open for further replies.

Hfnet

IS-IT--Management
Dec 31, 2003
369
GB
I am trying to do a search function to return all records associated with a name or part name. I have this code:

pID = "*" & UCase(Me.Text316.Value) & "*"
Me.RecordSource = "SELECT TOP 100 PERCENT itemsmain.*, customercategories.custcatdescr, itemstype.itemtypedescr, ModelTypes.ModelType, Departments.Department, " & _
"users.username, subrepairstatus.subrepair, itemsrepairstatus.status " & _
"FROM ((((((itemsmain " & _
"LEFT OUTER JOIN ModelTypes ON itemsmain.itemtypemodel = ModelTypes.ID) " & _
"LEFT OUTER JOIN customercategories ON itemsmain.custcatid = customercategories.id) " & _
"LEFT OUTER JOIN subrepairstatus ON itemsmain.subrepairstatus = subrepairstatus.ID) " & _
"LEFT OUTER JOIN Departments ON itemsmain.DeptID = Departments.ID) " & _
"LEFT OUTER JOIN itemsrepairstatus ON itemsmain.repairstatus = itemsrepairstatus.id) " & _
"LEFT OUTER JOIN itemstype ON itemsmain.itemtypeid = itemstype.ID) " & _
"LEFT OUTER JOIN users ON itemsmain.userid = users.id " & _
"WHERE UCase(itemsmain.custname) LIKE" & SQLStr(pID) & " " & _
"ORDER BY itemsmain.datein DESC"

To return all records containing the text in Text316, but it fails saying UCase not recognised.

How do I adapt this query? It's an adp.
 
Sorry, figured it out, thanks
 
Care to share the answer? Love to know...

---
Jeremy Wallace
METRIX Project Coordinator
Fund for the City of New York
 
Yeah, I said it was a project right, well, look at line 1, it should be

pID = "%" & LCase(Me.Text316.Value) & "%"

And then the UCase line can be changed to

"WHERE itemsmain.custname LIKE" & SQLStr(pID) & " " & _

pID = "%" & LCase(Me.Text316.Value) & "%"
Me.RecordSource = "SELECT TOP 100 PERCENT itemsmain.*, customercategories.custcatdescr, itemstype.itemtypedescr, ModelTypes.ModelType, Departments.Department, " & _
"users.username, subrepairstatus.subrepair, itemsrepairstatus.status " & _
"FROM ((((((itemsmain " & _
"LEFT OUTER JOIN ModelTypes ON itemsmain.itemtypemodel = ModelTypes.ID) " & _
"LEFT OUTER JOIN customercategories ON itemsmain.custcatid = customercategories.id) " & _
"LEFT OUTER JOIN subrepairstatus ON itemsmain.subrepairstatus = subrepairstatus.ID) " & _
"LEFT OUTER JOIN Departments ON itemsmain.DeptID = Departments.ID) " & _
"LEFT OUTER JOIN itemsrepairstatus ON itemsmain.repairstatus = itemsrepairstatus.id) " & _
"LEFT OUTER JOIN itemstype ON itemsmain.itemtypeid = itemstype.ID) " & _
"LEFT OUTER JOIN users ON itemsmain.userid = users.id " & _
"WHERE itemsmain.custname LIKE" & SQLStr(pID) & " " & _
"ORDER BY itemsmain.custname ASC, itemsmain.datein DESC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top