dsum problem

A

Alan

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'")
 
D

Daryl S

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...
 
D

Douglas J. Steele

Already answered in another newsgroup to which you posted the same question.
 
A

Alan

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 said:
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 said:
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'")
 
A

Alan

Well its not working this time around that why i'm asking to why

Douglas J. Steele said:
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 said:
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'")


.
 
A

Alan

Hi

=DSum("[AmountActual]","[Sales Analysis]","[Posting Date Period] = '" &
[cbMonth] & "'" And "[Revenue Stream Division] = 'Production'")

The posting date period is correct but soon as i add in

"[Revenue Stream Division] = 'Production'")

it just give the a value not specific to that posting period date

thanks in advance
 
D

Douglas J. Steele

You still haven't corrected the quotes. And must be inside the quotes, not
outside them.

=DSum("[AmountActual]","[Sales Analysis]","[Posting Date Period] = '" &
[cbMonth] & "' And [Revenue Stream Division] = 'Production'")

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

Alan said:
Hi

=DSum("[AmountActual]","[Sales Analysis]","[Posting Date Period] = '" &
[cbMonth] & "'" And "[Revenue Stream Division] = 'Production'")

The posting date period is correct but soon as i add in

"[Revenue Stream Division] = 'Production'")

it just give the a value not specific to that posting period date

thanks in advance

Alan said:
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'")
 
R

RonaldoOneNil

You extra double quotes where you don't need them

..... [cbMonth] & "' And [Revenue Stream Division] = 'Production'")

Alan said:
Hi

=DSum("[AmountActual]","[Sales Analysis]","[Posting Date Period] = '" &
[cbMonth] & "'" And "[Revenue Stream Division] = 'Production'")

The posting date period is correct but soon as i add in

"[Revenue Stream Division] = 'Production'")

it just give the a value not specific to that posting period date

thanks in advance

Alan said:
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'")
 
D

Daryl S

Alan -

To reference the selected value in a combo-box, include the column you need
(column 0 is the first column, etc.). Since you have single quotes around
it, I assume this value is text (use your form name).

Forms![YourFormName]![cbmonth].Column(0)


--
Daryl S


Alan said:
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 said:
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 said:
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'")
 
A

Alan

And [Revenue Stream Division] = 'Production'")

thank very much just one last thing

how do i get the code at top to look at "production" and "other"

Douglas J. Steele said:
You still haven't corrected the quotes. And must be inside the quotes, not
outside them.

=DSum("[AmountActual]","[Sales Analysis]","[Posting Date Period] = '" &
[cbMonth] & "' And [Revenue Stream Division] = 'Production'")

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

Alan said:
Hi

=DSum("[AmountActual]","[Sales Analysis]","[Posting Date Period] = '" &
[cbMonth] & "'" And "[Revenue Stream Division] = 'Production'")

The posting date period is correct but soon as i add in

"[Revenue Stream Division] = 'Production'")

it just give the a value not specific to that posting period date

thanks in advance

Alan said:
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'")


.
 
D

Douglas J. Steele

Do you mean you want records where [Revenue Stream Division] is 'Production'
and you also want records where [Revenue Stream Division] is 'Other'?

And [Revenue Stream Division] IN ('Production', 'Other')")

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

Alan said:
And [Revenue Stream Division] = 'Production'")

thank very much just one last thing

how do i get the code at top to look at "production" and "other"

Douglas J. Steele said:
You still haven't corrected the quotes. And must be inside the quotes,
not
outside them.

=DSum("[AmountActual]","[Sales Analysis]","[Posting Date Period] = '" &
[cbMonth] & "' And [Revenue Stream Division] = 'Production'")

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

Alan said:
Hi

=DSum("[AmountActual]","[Sales Analysis]","[Posting Date Period] = '" &
[cbMonth] & "'" And "[Revenue Stream Division] = 'Production'")

The posting date period is correct but soon as i add in

"[Revenue Stream Division] = 'Production'")

it just give the a value not specific to that posting period date

thanks in advance

:

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'")


.
 

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

Top