Toby,
Are you putting the expression in the field "cell" (correct) or in a
criteria "cell" (incorrect)? I would use the following expression if
Sale
Office could ever be null (blank).
Field: TheOffice: Mid([sales office],InStr([sales office] & "" ,"-")+1)
Alternative expression to use
Field: TheOffice: IIF([Sales Office] is not Null, Mid([sales
office],InStr([sales office],"-")+1),Null)
Why test for null or eliminate it by appending a zero-length string: If
the
field is Null, then Instr will return null which will cause Mid to
generate
an error since it does not handle null as its second argument..
--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
toby said:
ack! I typed "=" instead of the plus sign. no matter, I redid that
same
thing in the query and now I get: data type mismatch in criteria
expression.
hmmmm. any ideas? thanks again.
:
yes, that is correct. I want everything to the right of that dash. and
they
all have this dash. oh except for the ones that are blank, meaning
they
have
no dash. what happens to them? I did use your formula below and got
"invalid
procedure call". could the blanks in that field be the reason for
that?
here's what I have for the qualifier now (that returns the error just
mentioned):
=Mid([sales office],InStr([sales office],"-")=1)
thanks much!
:
On Mon, 11 Feb 2008 14:53:01 -0800, toby wrote:
I have a field that looks like this: 12/TX-Dallas
I am hoping to extract out only the sales office, in this case
it's
Dallas.
I tried the =right([sales office],35) thinking that there would be
no
sales
office larger than 35 characters. that didn't work.
please help. thanks in advance
So you wish whatever text is to the right of the hyphen?
FieldOffice:Mid([SalesOffice],InStr([SalesOffice],"-")+1)