hi,
> I'm not sure I understand, the double and single quotes are not intrinsic in
> the variable. The department variable might equal: Parks and Recreation (no
> quotes at all).
You should use it to avoid SQL injection, when creating SQL strings and
conditions. You never know when there is an single quote in your variable.
> I tried removing some of the quotes to:
>
> DSum("[HEAD_COUNT]", MyGlobalTableVariable, "[DEPT1] = '" &
> MyLocalDeptVariable & "'")
>
> But, this still fails...
What error message do you get?
Are you sure that MyGlobalTableVariable and MyLocalDeptVariable contain
the right values?
How do you invoke your function?
mfg
--> stefan <--
XP - 28 Jan 2007 19:03 GMT
I get "You cancelled the previous operation." error; yet when I remove my
DSUM it runs fine.
The variables are good, I checked them using DEBUG and rested my cursor on
them and they show the correct values; also I checked using MsgBox.
It is invoked using an After_Update event on a combo box.
Any ideas?
> hi,
>
[quoted text clipped - 19 lines]
> mfg
> --> stefan <--
XP - 28 Jan 2007 19:05 GMT
Hi Stefan,
SOOORRRY; the column name in the table was changed and that did it!
> hi,
>
[quoted text clipped - 19 lines]
> mfg
> --> stefan <--