combo box look up text box error

A

Alan

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
 
D

Dorian

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

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