error message with DCount function

L

LP

Hi there
I get the message "the text is too long to be edited" when I enter a DCount
function in the control source of a text box in a report. It only has 2282
characters!!!
What is the maximum number of characters allowed in control source of a text
box?
regards
 
K

Klatuu

I am not sure what the maximum is, but a DCount that has 2282 characters
seems a bit unusual. Can you post the code, please?
 
L

LP

Thank you for your reply. I suppose this is a string and the maximum number
of characters in a string is 2048. Is that the answer?
 
L

LP

=(DCount("[Ethnicity]","qryYsEasterRegisters","[Ethnicity] IN ('African' ,
'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other' , 'Caribbean'
, 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' , 'North African'
, 'African Caribbean' , 'White & Black Carribbean' , 'Somali' , 'White &
Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South America' ,
'South American') ")+DCount("[Ethnicity]","qryYsMayRegisters","[Ethnicity] IN
('African' , 'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other'
, 'Caribbean' , 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' ,
'North African' , 'African Caribbean' , 'White & Black Carribbean' , 'Somali'
, 'White & Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South
America' , 'South American')
")+DCount("[Ethnicity]","qryYsSummerRegisters","[Ethnicity] IN ('African' ,
'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other' , 'Caribbean'
, 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' , 'North African'
, 'African Caribbean' , 'White & Black Carribbean' , 'Somali' , 'White &
Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South America' ,
'South American')
")+DCount("[Ethnicity]","qryYsOctoberRegisters","[Ethnicity] IN ('African' ,
'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other' , 'Caribbean'
, 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' , 'North African'
, 'African Caribbean' , 'White & Black Carribbean' , 'Somali' , 'White &
Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South America' ,
'South American')
")+DCount("[Ethnicity]","qryYsFebruaryRegisters","[Ethnicity] IN ('African' ,
'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other' , 'Caribbean'
, 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' , 'North African'
, 'African Caribbean' , 'White & Black Carribbean' , 'Somali' , 'White &
Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South America' ,
'South American')
"))/(DCount("[MemId]","qryYsEasterRegisters","[MemId]=True")+DCount("[MemId]","qryYsMayRegisters","[MemId]=True")+DCount("[MemId]","qryYsSummerRegisters","[MemId]=True")+DCount("[MemId]","qryYsOctoberRegisters","[MemId]=True")+DCount("[MemId]","qryYsFebruaryRegisters","[MemId]=True"))*100
 
K

Klatuu

I see why it is so long. If it is too long for a control source, how about
making it ito a query and using the query as the control source?
--
Dave Hargis, Microsoft Access MVP


LP said:
=(DCount("[Ethnicity]","qryYsEasterRegisters","[Ethnicity] IN ('African' ,
'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other' , 'Caribbean'
, 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' , 'North African'
, 'African Caribbean' , 'White & Black Carribbean' , 'Somali' , 'White &
Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South America' ,
'South American') ")+DCount("[Ethnicity]","qryYsMayRegisters","[Ethnicity] IN
('African' , 'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other'
, 'Caribbean' , 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' ,
'North African' , 'African Caribbean' , 'White & Black Carribbean' , 'Somali'
, 'White & Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South
America' , 'South American')
")+DCount("[Ethnicity]","qryYsSummerRegisters","[Ethnicity] IN ('African' ,
'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other' , 'Caribbean'
, 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' , 'North African'
, 'African Caribbean' , 'White & Black Carribbean' , 'Somali' , 'White &
Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South America' ,
'South American')
")+DCount("[Ethnicity]","qryYsOctoberRegisters","[Ethnicity] IN ('African' ,
'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other' , 'Caribbean'
, 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' , 'North African'
, 'African Caribbean' , 'White & Black Carribbean' , 'Somali' , 'White &
Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South America' ,
'South American')
")+DCount("[Ethnicity]","qryYsFebruaryRegisters","[Ethnicity] IN ('African' ,
'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other' , 'Caribbean'
, 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' , 'North African'
, 'African Caribbean' , 'White & Black Carribbean' , 'Somali' , 'White &
Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South America' ,
'South American')
"))/(DCount("[MemId]","qryYsEasterRegisters","[MemId]=True")+DCount("[MemId]","qryYsMayRegisters","[MemId]=True")+DCount("[MemId]","qryYsSummerRegisters","[MemId]=True")+DCount("[MemId]","qryYsOctoberRegisters","[MemId]=True")+DCount("[MemId]","qryYsFebruaryRegisters","[MemId]=True"))*100

Klatuu said:
I don't think that is the maximum. I still would like to see the string.
 
L

LP

Good idea. Problem solved. thanks very much for your help. LP

Klatuu said:
I see why it is so long. If it is too long for a control source, how about
making it ito a query and using the query as the control source?
--
Dave Hargis, Microsoft Access MVP


LP said:
=(DCount("[Ethnicity]","qryYsEasterRegisters","[Ethnicity] IN ('African' ,
'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other' , 'Caribbean'
, 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' , 'North African'
, 'African Caribbean' , 'White & Black Carribbean' , 'Somali' , 'White &
Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South America' ,
'South American') ")+DCount("[Ethnicity]","qryYsMayRegisters","[Ethnicity] IN
('African' , 'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other'
, 'Caribbean' , 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' ,
'North African' , 'African Caribbean' , 'White & Black Carribbean' , 'Somali'
, 'White & Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South
America' , 'South American')
")+DCount("[Ethnicity]","qryYsSummerRegisters","[Ethnicity] IN ('African' ,
'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other' , 'Caribbean'
, 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' , 'North African'
, 'African Caribbean' , 'White & Black Carribbean' , 'Somali' , 'White &
Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South America' ,
'South American')
")+DCount("[Ethnicity]","qryYsOctoberRegisters","[Ethnicity] IN ('African' ,
'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other' , 'Caribbean'
, 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' , 'North African'
, 'African Caribbean' , 'White & Black Carribbean' , 'Somali' , 'White &
Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South America' ,
'South American')
")+DCount("[Ethnicity]","qryYsFebruaryRegisters","[Ethnicity] IN ('African' ,
'Afroe-European' , 'ALGERIAN' , 'Black British' , 'Black Other' , 'Caribbean'
, 'Latin American' , 'MEXICAN' , 'Mixed Race' , 'MOROCCAN' , 'North African'
, 'African Caribbean' , 'White & Black Carribbean' , 'Somali' , 'White &
Black African' , 'Eritrea' , 'West Indias' , 'Eriterien' , 'South America' ,
'South American')
"))/(DCount("[MemId]","qryYsEasterRegisters","[MemId]=True")+DCount("[MemId]","qryYsMayRegisters","[MemId]=True")+DCount("[MemId]","qryYsSummerRegisters","[MemId]=True")+DCount("[MemId]","qryYsOctoberRegisters","[MemId]=True")+DCount("[MemId]","qryYsFebruaryRegisters","[MemId]=True"))*100

Klatuu said:
I don't think that is the maximum. I still would like to see the string.
--
Dave Hargis, Microsoft Access MVP


:

Thank you for your reply. I suppose this is a string and the maximum number
of characters in a string is 2048. Is that the answer?

:

I am not sure what the maximum is, but a DCount that has 2282 characters
seems a bit unusual. Can you post the code, please?
--
Dave Hargis, Microsoft Access MVP


:

Hi there
I get the message "the text is too long to be edited" when I enter a DCount
function in the control source of a text box in a report. It only has 2282
characters!!!
What is the maximum number of characters allowed in control source of a text
box?
regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top