Hum, perhaps using some function(S) on the string that are limited to 255
characters....
For example, if you try and return a memo field from sql, but surround the
memo field with a function, it often gets truncated to 255 chars.
However, your case sound different....
I would suggest using the debugger...step thought the code in question....
most common mistake in code that concatenation strings is
strSql = "select * from tableCustomer " & _
"where "
strSql = "City = 'Edmonton'"
In the above...the 2nd line is wrong...and should read...
strSql = sqlSql & "City = 'Edmotnon'"
Also, be aware that when you use "+" to concat values, null WILL prorogate,
and if you use "&", then nulll will not....
This quirk of VBA can be used to your advantage.....
eg:
UserNAme = "(FirstName) & (" " + MiddleInitial) & (" " + LastName))
In the above, if you don't have a middle name, then the extra space would
NOT be inserted...
And, the same goes for the last name....no extra space on the end if no
middle, or last name. However, with either a middle name, or a last
name...it works. This simply expression eliminates some quite complex iff()
statements to achieve the same result...
However, if you use
UserNAme = "(FirstName) & (" " & MiddleInitial) & (" " & LastName))
In the above...you will ALWAYS have a extra space when no middle name (or
last name) is present. Using & means nulls don't propagate through the
expression.
So, check your syntax. And check for "appropriate" use of "+" or "&" to
concat strings....
note that
"hello" + null value = null
"hello" & null value = "hello"