I'm not.
I am not trying to add characters where the ***, I am trying to add the line
" AND (tblPurchaseOrder.OrderDate " & strDateClause & "));"
to the end of strSql.
but when i print the watch, the following appears
"Contents of strSql" AND (tb
Ie the line " AND (tblPurchaseOrder.OrderDate " & strDateClause & "));"
only partially gets added. - even if I change the line being added.
I know I aint explaining it too well...
Thank you
> Adding more characters after the closing semicolon won't be very successful.
>
[quoted text clipped - 69 lines]
> >> >> > Does anyone know why this would be?
> >> >> > Thank you
Okay, firstly I'd just like to assure you that the string can be many
characters long, so the problem is not with VBA or JET SQL.
There is a finite limit to the number of line continuation characters you
can use, but your example doesn't have enough for that to be an issue
either.
It is important to edit these strings only while the form is open in
*design* view, not while it is in use, as that can corrupt the database. In
case that has happened:
1. Compact the database:
Tools | Database Utilities | Compact.
2. Close Access.
3. Decompile a copy of the database by entering something like this at the
command prompt while Access is not running. It is all one line, and include
the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
4. Compact again.
5. Open the code window, and check that the code compiles (Compile on Debug
menu.) Then try editing the string again.
6. Before you try to OpenRecordset, dump the string to the Immediate window
with:
Debug.Print strSql
to see what Access is making of it.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> I'm not.
> I am not trying to add characters where the ***, I am trying to add the
[quoted text clipped - 95 lines]
>> >> >> > Does anyone know why this would be?
>> >> >> > Thank you
tpkt - 12 Sep 2005 16:35 GMT
Ok.
Its the end of the day over here, so I will wait till I am home to try it,
Thanks,
K
> Okay, firstly I'd just like to assure you that the string can be many
> characters long, so the problem is not with VBA or JET SQL.
[quoted text clipped - 127 lines]
> >> >> >> > Does anyone know why this would be?
> >> >> >> > Thank you
tpkt - 14 Sep 2005 13:51 GMT
Alan,
the problem was with my logic in a piece of code further up. However if you
set up a watch, the watch is only capable of displaying the first 255
characters in a string and not the full string and this is what was leading
to the confusion.
thanks
KM
> Ok.
> Its the end of the day over here, so I will wait till I am home to try it,
[quoted text clipped - 132 lines]
> > >> >> >> > Does anyone know why this would be?
> > >> >> >> > Thank you
Allen Browne - 14 Sep 2005 16:09 GMT
Good news! You have it solved.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Alan,
> the problem was with my logic in a piece of code further up. However if
[quoted text clipped - 3 lines]
> leading
> to the confusion.