By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,930 Members | 1,269 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,930 IT Pros & Developers. It's quick & easy.

String up to 2048 characters long??

P: 14
Hi all,

This is based off of a previous thread that I had but it's a whole new problem. I'm entering a DSum formula into a text box on a report and I keep getting an error message back saying:

The expression you entered has an invalid string.
A string can be up to 2048 characters long, including opening and closing quotation marks.

The funny thing is that the formula that I've entered that is apparently too long only has 156 characters in it. Why am I getting this message? Is there anything I can do to get around the problem? I'm so close to finishing this database, I just need to get past this one last problem.
Oct 5 '07 #1
Share this Question
Share on Google+
4 Replies

Expert 2.5K+
P: 3,532
We'll need to see the string!

Linq ;0)>
Oct 5 '07 #2

P: 14
Sorry about that, I meant to put in in the last post. Must have been too excited to hit submit.

Here's the string:

=DSum("[Trial Balance Amount]","DDRS Data","[Acct] = " & [Acct] & " AND [Program Description]= '" & [Program Description] & "'" AND [Fed]= '" & [Fed] & "'")

Like I said, it's telling me that strings can only be 2,048 characters long, but this is 155 or 156. It's going to get longer as I add more elements, but it should still be less than 1,000. Any ideas?
Oct 5 '07 #3

Expert 2.5K+
P: 3,072
The error is cause because there is an error in the number of quotes and Access can't find the end.
Expand|Select|Wrap|Line Numbers
  1. =DSum("[Trial Balance Amount]","DDRS Data","[Acct] = " & [Acct] & " AND [Program Description]= '" & [Program Description] & "' AND [Fed]= '" & [Fed] & "'")
The " before the AND in [Program Description] & "'" AND has been removed.

Oct 5 '07 #4

P: 14
Great. Thanks for all the help! I should be good to go now.
Oct 5 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.