querying by first part of record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having difficulty returning records that search for text. I want to be
able to return everything that starts with the entry I use. my criteria
looks like this:

[Forms]![COMP]![TECHNICIAN]

I have tried,

LIKE "[Forms]![COMP]![TECHNICIAN]*" and I get nothing.

I don't know where to go from here, perhaps I should try a LEFT function???

Thanks,
Nick
 
I appreciate your help, that completely fixed my problem.
keep up the good work.
thanks
Nick

Duane Hookom said:
Try:
LIKE [Forms]![COMP]![TECHNICIAN] & "*"

--
Duane Hookom
MS Access MVP
--

cherrynich said:
I am having difficulty returning records that search for text. I want to
be
able to return everything that starts with the entry I use. my criteria
looks like this:

[Forms]![COMP]![TECHNICIAN]

I have tried,

LIKE "[Forms]![COMP]![TECHNICIAN]*" and I get nothing.

I don't know where to go from here, perhaps I should try a LEFT
function???

Thanks,
Nick
 
I have one more question, how would the criteria be setup if I wanted to
search for part of the entry that was in the middle of the record???
thanks

Duane Hookom said:
Try:
LIKE [Forms]![COMP]![TECHNICIAN] & "*"

--
Duane Hookom
MS Access MVP
--

cherrynich said:
I am having difficulty returning records that search for text. I want to
be
able to return everything that starts with the entry I use. my criteria
looks like this:

[Forms]![COMP]![TECHNICIAN]

I have tried,

LIKE "[Forms]![COMP]![TECHNICIAN]*" and I get nothing.

I don't know where to go from here, perhaps I should try a LEFT
function???

Thanks,
Nick
 
what I neglected to say in the last post is, I'd like to make it to where I
could find the entry in any part of the record, how would I set that up???

Duane Hookom said:
Try:
LIKE [Forms]![COMP]![TECHNICIAN] & "*"

--
Duane Hookom
MS Access MVP
--

cherrynich said:
I am having difficulty returning records that search for text. I want to
be
able to return everything that starts with the entry I use. my criteria
looks like this:

[Forms]![COMP]![TECHNICIAN]

I have tried,

LIKE "[Forms]![COMP]![TECHNICIAN]*" and I get nothing.

I don't know where to go from here, perhaps I should try a LEFT
function???

Thanks,
Nick
 
I have one more question, how would the criteria be setup if I wanted to
search for part of the entry that was in the middle of the record???
thanks

You're building a String out of pieces. If you were using a
hand-entered query you would use * as a wildcard for "any string of
characters"; so to find the string FRED anywhere in a field you'ld use
a criterion of

LIKE "*FRED*"

So if you're using concatenation of string constants and variables
(form references) to do the same thing, just append an asterisk before
and after:

LIKE "*" & [Forms]![COMP]![TECHNICIAN] & "*"

Note that if the user leaves the TECHNICIAN textbox blank this will
return all records in the table.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top