DCOUNT Funtion

shamas21

Registered User.
Local time
Today, 19:40
Joined
May 27, 2008
Messages
162
Hi All

Im trying to use this formula in a textbox on my form

=DCount("[Area of SRM]","tb1lFull Client info","Area of SRM = 'RMP' ")

"Area of SRM" = The field in the table
"tb1lFull Client info" = The table that contains the field
"Area of SRM = 'RMP' " = The condition

It comes back with #Error. Can someone tell me how to fix this?

Thanks
 
Hi All

Im trying to use this formula in a textbox on my form

=DCount("[Area of SRM]","tb1lFull Client info","[Area of SRM] = 'RMP' ")

"Area of SRM" = The field in the table
"tb1lFull Client info" = The table that contains the field
"Area of SRM = 'RMP' " = The condition

It comes back with #Error. Can someone tell me how to fix this?

Thanks

Because the Field [Area of SRM] contains Special Characters (in this case Spaces) it always needs to be surrounded by Brackets. See the proposed correction in the example above. You should also consider renaming the Field to not use the Special Characters if it is possible to do so.
 
Because of the inadvisable spaces, you'd need to bracket all your field and table names.
 
You may have to wrap the table name in [] too.

Always best to avoid spaces in object names.
 

Users who are viewing this thread

Back
Top Bottom