SYntax or quite marks !

  • Thread starter Thread starter SJ
  • Start date Start date
S

SJ

Hi I using the following syntax in a text box on an Access report. I am
getting and error message, either syntax or quote marks.

Can some kind person tell me what is wrong please- thanks

="Thank you for your recent enquiry - we have pleasure in enclosing " &
(If([Quantity])=1,"a leaflet and a preview copy", [Quantity] & " leaflets
and preview copies") & "of more text etc. "
 
Lynn, I have tried that earlier and I got "Wrong number of arguements error!


Lynn Trapp said:
Change If([Quantity]..... to IIF([Quantity].....

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


SJ said:
Hi I using the following syntax in a text box on an Access report. I am
getting and error message, either syntax or quote marks.

Can some kind person tell me what is wrong please- thanks

="Thank you for your recent enquiry - we have pleasure in enclosing " &
(If([Quantity])=1,"a leaflet and a preview copy", [Quantity] & " leaflets
and preview copies") & "of more text etc. "
 
Are you doing this in the Query grid or in VBA?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


SJ said:
Lynn, I have tried that earlier and I got "Wrong number of arguements
error!


Lynn Trapp said:
Change If([Quantity]..... to IIF([Quantity].....

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


SJ said:
Hi I using the following syntax in a text box on an Access report. I am
getting and error message, either syntax or quote marks.

Can some kind person tell me what is wrong please- thanks

="Thank you for your recent enquiry - we have pleasure in enclosing " &
(If([Quantity])=1,"a leaflet and a preview copy", [Quantity] & "
leaflets and preview copies") & "of more text etc. "
 
In VBA

Alex

Lynn Trapp said:
Are you doing this in the Query grid or in VBA?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


SJ said:
Lynn, I have tried that earlier and I got "Wrong number of arguements
error!


Lynn Trapp said:
Change If([Quantity]..... to IIF([Quantity].....

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


Hi I using the following syntax in a text box on an Access report. I
am getting and error message, either syntax or quote marks.

Can some kind person tell me what is wrong please- thanks

="Thank you for your recent enquiry - we have pleasure in enclosing " &
(If([Quantity])=1,"a leaflet and a preview copy", [Quantity] & "
leaflets and preview copies") & "of more text etc. "
 
Ok.. .then is everything in your statement contained on one line or are
there line breaks? What's on the left side of your equal sign?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


SJ said:
In VBA

Alex

Lynn Trapp said:
Are you doing this in the Query grid or in VBA?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


SJ said:
Lynn, I have tried that earlier and I got "Wrong number of arguements
error!


Change If([Quantity]..... to IIF([Quantity].....

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


Hi I using the following syntax in a text box on an Access report. I
am getting and error message, either syntax or quote marks.

Can some kind person tell me what is wrong please- thanks

="Thank you for your recent enquiry - we have pleasure in enclosing "
& (If([Quantity])=1,"a leaflet and a preview copy", [Quantity] & "
leaflets and preview copies") & "of more text etc. "
 
Hi Lyn

Ok this is what is in my text box at present:

="Thank you for your recent enquiry - we have pleasure in enclosing " &
(If([Quantity])=1,"a leaflet and a preview copy",[Quantity] & " leaflets and
preview copies") & "of rest of text etc till another"

Thanks for your help, this one has been driving me nuts for two hours -



Lynn Trapp said:
Ok.. .then is everything in your statement contained on one line or are
there line breaks? What's on the left side of your equal sign?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


SJ said:
In VBA

Alex

Lynn Trapp said:
Are you doing this in the Query grid or in VBA?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


Lynn, I have tried that earlier and I got "Wrong number of arguements
error!


Change If([Quantity]..... to IIF([Quantity].....

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


Hi I using the following syntax in a text box on an Access report. I
am getting and error message, either syntax or quote marks.

Can some kind person tell me what is wrong please- thanks

="Thank you for your recent enquiry - we have pleasure in enclosing "
& (If([Quantity])=1,"a leaflet and a preview copy", [Quantity] & "
leaflets and preview copies") & "of more text etc. "
 
So it's in the record source for your textbox? Is that right? I don't see
anything wrong except that it still has IF instead of IIF. Try this:

="Thank you for your recent enquiry - we have pleasure in enclosing " &
IIF([Quantity]=1,"a leaflet and a preview copy",[Quantity] & " leaflets and
preview copies") & "of rest of text etc till another"

I think the error had to do with too many Parentheses too.


--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


SJ said:
Hi Lyn

Ok this is what is in my text box at present:

="Thank you for your recent enquiry - we have pleasure in enclosing " &
(If([Quantity])=1,"a leaflet and a preview copy",[Quantity] & " leaflets
and preview copies") & "of rest of text etc till another"

Thanks for your help, this one has been driving me nuts for two hours -



Lynn Trapp said:
Ok.. .then is everything in your statement contained on one line or are
there line breaks? What's on the left side of your equal sign?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


SJ said:
In VBA

Alex

Are you doing this in the Query grid or in VBA?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


Lynn, I have tried that earlier and I got "Wrong number of arguements
error!


Change If([Quantity]..... to IIF([Quantity].....

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


Hi I using the following syntax in a text box on an Access report.
I am getting and error message, either syntax or quote marks.

Can some kind person tell me what is wrong please- thanks

="Thank you for your recent enquiry - we have pleasure in enclosing
" & (If([Quantity])=1,"a leaflet and a preview copy", [Quantity] & "
leaflets and preview copies") & "of more text etc. "
 
That workedLynn - As you say,must have had too many Parentheses

Many thanks foryour help

A

Lynn Trapp said:
So it's in the record source for your textbox? Is that right? I don't see
anything wrong except that it still has IF instead of IIF. Try this:

="Thank you for your recent enquiry - we have pleasure in enclosing " &
IIF([Quantity]=1,"a leaflet and a preview copy",[Quantity] & " leaflets
and
preview copies") & "of rest of text etc till another"

I think the error had to do with too many Parentheses too.


--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


SJ said:
Hi Lyn

Ok this is what is in my text box at present:

="Thank you for your recent enquiry - we have pleasure in enclosing " &
(If([Quantity])=1,"a leaflet and a preview copy",[Quantity] & " leaflets
and preview copies") & "of rest of text etc till another"

Thanks for your help, this one has been driving me nuts for two hours -



Lynn Trapp said:
Ok.. .then is everything in your statement contained on one line or are
there line breaks? What's on the left side of your equal sign?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


In VBA

Alex

Are you doing this in the Query grid or in VBA?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


Lynn, I have tried that earlier and I got "Wrong number of arguements
error!


Change If([Quantity]..... to IIF([Quantity].....

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


Hi I using the following syntax in a text box on an Access report.
I am getting and error message, either syntax or quote marks.

Can some kind person tell me what is wrong please- thanks

="Thank you for your recent enquiry - we have pleasure in enclosing
" & (If([Quantity])=1,"a leaflet and a preview copy", [Quantity] &
" leaflets and preview copies") & "of more text etc. "
 
You are quite welcome. I'm glad you figured it out.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


Alex H said:
That workedLynn - As you say,must have had too many Parentheses

Many thanks foryour help

A

Lynn Trapp said:
So it's in the record source for your textbox? Is that right? I don't see
anything wrong except that it still has IF instead of IIF. Try this:

="Thank you for your recent enquiry - we have pleasure in enclosing " &
IIF([Quantity]=1,"a leaflet and a preview copy",[Quantity] & " leaflets
and
preview copies") & "of rest of text etc till another"

I think the error had to do with too many Parentheses too.


--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


SJ said:
Hi Lyn

Ok this is what is in my text box at present:

="Thank you for your recent enquiry - we have pleasure in enclosing " &
(If([Quantity])=1,"a leaflet and a preview copy",[Quantity] & " leaflets
and preview copies") & "of rest of text etc till another"

Thanks for your help, this one has been driving me nuts for two hours -



Ok.. .then is everything in your statement contained on one line or are
there line breaks? What's on the left side of your equal sign?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


In VBA

Alex

Are you doing this in the Query grid or in VBA?

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


Lynn, I have tried that earlier and I got "Wrong number of
arguements error!


Change If([Quantity]..... to IIF([Quantity].....

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Big List: www.ltcomputerdesigns.com/JCReferences.html


Hi I using the following syntax in a text box on an Access report.
I am getting and error message, either syntax or quote marks.

Can some kind person tell me what is wrong please- thanks

="Thank you for your recent enquiry - we have pleasure in
enclosing " & (If([Quantity])=1,"a leaflet and a preview copy",
[Quantity] & " leaflets and preview copies") & "of more text etc.
"
 
Back
Top