Charlotte,
I'm sorry. I just typed that in to my response. Didn't test it inAccess.
I got 1 too many parentheses in there. Try this:
RemoveText:
Iif(InStr([Title],"(")=0,[Title],Left([Title],InStr([Title],"(")-1) &
Mid([Title],InStr([Title],")")+2))
(make sure all of that is on one line)
In case you were wondering where my mistake was, it was near the biginning:
RemoveText: Iif(InStr([Title]),"(")=0...
Should have been
RemoveText: Iif(InStr([Title],"(")=0...
I had a closing (right) parentheses just after [Title].
Now that syntax should be correct, but I have not tested it. I think that
it will work for you, but let me know if it is still causing problems.
HTH,
Conan
On Feb 14, 6:29 pm, "Conan Kelly"
Charlotte,
RemoveText:
Iif(InStr([Title]),"(")=0,[Title],Left([Title],InStr([Title],"(")-1) &
Mid([Title],InStr([Title],")")+2))
That will only look for a "(". If it can not find one, it will return
the
original value of [Title]. If it does find one it will return [Title]
with
everything betweenparenthesesremoved.
I can also adjust it to test for ")".......or "(" AND ")".......or "(" OR
")". What ever your needs require. Just let me know.
HTH,
Conan
On Thu, 14 Feb 2008 14:23:49 -0800 (PST),Charlottewrote:
I need to write aquerythat willstripparenthesis and the text
contained in theparenthesis. Example:
current: The cow (jumped over) the moon
new: The cow the moon
The below example I found willstripall text after the left
parenthesis"(", but I need to keep the text following the close ")"
parenthesis.
LongName: Left([Title],InStr([Title],"("),([Title],")")-1)
Charlotte
RemoveText: Left([Title],InStr([Title],"(")-1) & Mid([Title],
InStr([Title],")")+2)
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Wow. Thank you so much for your fast response. That worked! Do you
know how I can modify thequeryto not return #Error on records that
do not containparenthesis?
Thanks again for the fast response. For some reason, I'm getting an
invalid syntax on that expression.