Re: Concatenate error - Duane Hookom's concat function
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Thu, 18 Jan 2007 09:26:35 -0500
No, you don't have it right. (all on one line, it should look like the
following). Remember that you need to have an even number of quote marks
once you finish the entry. Try
RegionTest: Concatenate("SELECT CongregationName FROM tblCongregation WHERE
Region = '" & [Region] &"'")
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
"Kat" <Kat@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DD4DF4A5-0099-4F39-9D97-1AABAE5DBB77@xxxxxxxxxxxxxxxx
Have I got this right? The new code would be:
RegionTest: Concatenate("SELECT CongregationName FROM tblCongregation
WHERE
"Region = '" & [Region] &"'")
This doesn't seem to work. I get an error:
"The expression you entered contains invalid syntax. You may have entered
an
operand without an operator."
Did I miss something?
Sorry to be a pain.
"Al Campagna" wrote:
Kat,
Since Region is a text field it should be in it's own quotes...
"Region = '" & [Region] &"'"
I'll put spaces in the quotes for clarity, but don't use them in the
code...
"Region = ' " & [Region] & " ' "
--
hth
Al Campagna
Candia Computer Consulting
Microsoft Access MVP - Candia, NH USA
http://home.comcast.net/~cccsolutions
"Find a job that you love, and you'll never work a day in your life."
"Kat" <Kat@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E8548303-353A-4640-ADC1-4822BF2FD1A4@xxxxxxxxxxxxxxxx
I followed the Duane Hookom's directions for setting up a concatenate
function in my database. As far as I can tell it's all set up
correctly...
I copied the basConcatenate function over to my database and in my
query I'm
using the VBA code:
RegionTest: Concatenate("SELECT CongregationName FROM tblCongregation
WHERE
Region =" & [Region])
But when I run the query, it comes up with an error for each row:
Run-time error '-2147217900 (8004e14)':
Syntax error (missing operator) in query expression 'Region =North
West'.
(ie where the row is for the North West region)
What have I done wrong??
How do I fix it??
Please help!
.
- Follow-Ups:
- References:
- Re: Concatenate error - Duane Hookom's concat function
- From: Al Campagna
- Re: Concatenate error - Duane Hookom's concat function
- Prev by Date: Re: Concatenate error - Duane Hookom's concat function
- Next by Date: Suppressing address lines
- Previous by thread: Re: Concatenate error - Duane Hookom's concat function
- Next by thread: Re: Concatenate error - Duane Hookom's concat function
- Index(es):