From: Alan on
Can someone tell me what wrong with my dsem as the cbmonth is not working

=DSum("[AmountActual]","Sales Analysis","[Posting Date Period] = '" &
[cbmonth] & "'" And "Revenue stream divsion = 'Production'" And "Type =
'Actual'")
From: Daryl S on
Alan -

Any field names, table names, etc. with spaces or special characters need to
be surrounded by square brackets:

Also, what is [cbmonth]? Is it a control on a form? If so, it should be
either Me.[cbmonth] (if the code is on the form), or
Forms![YourFormName]![cbmonth] (if referred to outside the form).

=DSum("[AmountActual]","[Sales Analysis]","[Posting Date Period] = '" &
[cbmonth] & "'" And "[Revenue stream divsion] = 'Production'" And "[Type] =
'Actual'")

If you still have issues, tell us what [cbmonth] is so we can help with the
syntax...

--
Daryl S


"Alan" wrote:

> Can someone tell me what wrong with my dsem as the cbmonth is not working
>
> =DSum("[AmountActual]","Sales Analysis","[Posting Date Period] = '" &
> [cbmonth] & "'" And "Revenue stream divsion = 'Production'" And "Type =
> 'Actual'")
From: Douglas J. Steele on
Already answered in another newsgroup to which you posted the same question.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Alan" <Alan(a)discussions.microsoft.com> wrote in message
news:AC5CFEFB-4519-4996-99C0-BDB2C5258BC4(a)microsoft.com...
> Can someone tell me what wrong with my dsem as the cbmonth is not working
>
> =DSum("[AmountActual]","Sales Analysis","[Posting Date Period] = '" &
> [cbmonth] & "'" And "Revenue stream divsion = 'Production'" And "Type =
> 'Actual'")


From: Alan on
cbmonth is a combo box with is bound to table sales analysis "posting Date
Period", the format is 2010/07 not sure if its text or date??

i put in the ME. function and i get #?Name error, if i leave it out i get a
value but wrong total

"Daryl S" wrote:

> Alan -
>
> Any field names, table names, etc. with spaces or special characters need to
> be surrounded by square brackets:
>
> Also, what is [cbmonth]? Is it a control on a form? If so, it should be
> either Me.[cbmonth] (if the code is on the form), or
> Forms![YourFormName]![cbmonth] (if referred to outside the form).
>
> =DSum("[AmountActual]","[Sales Analysis]","[Posting Date Period] = '" &
> [cbmonth] & "'" And "[Revenue stream divsion] = 'Production'" And "[Type] =
> 'Actual'")
>
> If you still have issues, tell us what [cbmonth] is so we can help with the
> syntax...
>
> --
> Daryl S
>
>
> "Alan" wrote:
>
> > Can someone tell me what wrong with my dsem as the cbmonth is not working
> >
> > =DSum("[AmountActual]","Sales Analysis","[Posting Date Period] = '" &
> > [cbmonth] & "'" And "Revenue stream divsion = 'Production'" And "Type =
> > 'Actual'")
From: Alan on
Well its not working this time around that why i'm asking to why

"Douglas J. Steele" wrote:

> Already answered in another newsgroup to which you posted the same question.
>
> --
> Doug Steele, Microsoft Access MVP
> http://www.AccessMVP.com/DJSteele
> (no e-mails, please!)
>
> "Alan" <Alan(a)discussions.microsoft.com> wrote in message
> news:AC5CFEFB-4519-4996-99C0-BDB2C5258BC4(a)microsoft.com...
> > Can someone tell me what wrong with my dsem as the cbmonth is not working
> >
> > =DSum("[AmountActual]","Sales Analysis","[Posting Date Period] = '" &
> > [cbmonth] & "'" And "Revenue stream divsion = 'Production'" And "Type =
> > 'Actual'")
>
>
> .
>