DCount() function throws error #102

hitech70

New member
Local time
Today, 03:46
Joined
Jun 8, 2018
Messages
4
I'm using MS Access to create a form to complete a data entry which store data in a MS SQL Server database, and I connect through ODBC, using SQL Server Native Client 11.0

When using the DCount() function to find out the count of records with certain text, and when the Criteria has a text of 255 characters, it fails and throws the following error

unclosed quotation mark after the character string #102

Are you aware of any limitation on the maximum length of the criteria which can specified?

Or any workaround to this issue?
 
A workaround would be to open a recordset on SQL that returned the desired count.
 
Thank you for your reply.

Yes, sure. But I thought there could a fix for the dcount() limitation or something else

A workaround would be to open a recordset on SQL that returned the desired count.
 
I'm not sure about the limit. If you're close, you may be able to eliminate the table name or something. Hard to say without seeing how it's built. You may be able to use IN() instead of a string of OR items.
 
It all depends on exactly how they are coded, but it is not uncommon to find that a function's short-text (string) argument has a 255 character limit.

If you look at the specifications, you will see MANY items for which a limit of 255 characters has been imposed. I've got a link for Ac2016, but I'm pretty sure that other versions will be at least similar.

http://www.avantixlearning.ca/micro...ns-microsoft-access-training-course-resource/
 

Users who are viewing this thread

Back
Top Bottom