From: Alan on
I used this code

=DSum("Amount",
"[July 09 - On Billings and Adjustments Data Query]",
" [Customer No#] = " & cboCustomerNumber &
" AND Format([Posting Date Period], ""yyyymm"") = '" &
Format(cboPostingDate, "yyyymm") & "'")

to put the values in my text box

but i'm just getting #error in the text box

i have Customer Number box pulling the Customer number from the customer
listing table, and the rest coming from the July 09 - On Billings and
Adjustments Data Query

, would this give me my error??

Thanks yous again for you expert advice
From: Dorian on
It's not advisable to use embedded spaces or any special characters in your
table or column names as it can cause problems.
The first thing to do is to display your query e.g.
Dim strSQL as string
strSQL = " [Customer No#] = " & cboCustomerNumber &
" AND Format([Posting Date Period], ""yyyymm"") = '" &
Format(cboPostingDate, "yyyymm") & "'"
Msgbox strSQL

to see what you are getting.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"Alan" wrote:

> I used this code
>
> =DSum("Amount",
> "[July 09 - On Billings and Adjustments Data Query]",
> " [Customer No#] = " & cboCustomerNumber &
> " AND Format([Posting Date Period], ""yyyymm"") = '" &
> Format(cboPostingDate, "yyyymm") & "'")
>
> to put the values in my text box
>
> but i'm just getting #error in the text box
>
> i have Customer Number box pulling the Customer number from the customer
> listing table, and the rest coming from the July 09 - On Billings and
> Adjustments Data Query
>
> , would this give me my error??
>
> Thanks yous again for you expert advice