#error in text box

A

Alan

I have this code in a text box

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

i keep getting #error in my text box

i'm struggling to find they answer to why


the query July 09 - On Billings and Adjustments Data Query
has fields of

customer Number
posting periood date
Amount

Now i have two combo boxes on my form which the text box should look up

Customer number and Name, are bound to another table

No (for customer Number)
Name ( for customer Name

Customer Listing Table

not linked to July 09 - On Billings and Adjustments Data Query

Is this what causing my error and how do i fix it

Thanks in advanced
 
X

XPS350

I have this code in a  text box

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

i keep getting #error in my text box

i'm struggling to find they answer to why

the query July 09 - On  Billings and Adjustments Data Query
has fields of

customer Number
posting periood date
Amount

Now i have two combo boxes on my form which the text box should look up

Customer number and Name, are bound to another table

No (for customer Number)
Name ( for customer Name

Customer Listing Table

not linked  to July 09 - On  Billings and Adjustments Data Query

Is this what causing my error and how do i fix it

Thanks in advanced

Dates should be delimited by #. Try:
= dsum("[Amount]", "[July 09 - On Billings and Adjustments Data
Query]",
"[Customer No] = " & [cboCustomerNumber] & " AND Format([Posting Date
Period], ""yyyymm"") = #" & Format([cboPostingDate], "yyyymm") & "#")


Groeten,

Peter
http://access.xps350.com
 
F

fredg

I have this code in a text box

= dsum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]",
"[Customer No] = " & [cboCustomerNumber] & " AND Format([Posting Date
Period], ""yyyymm"") ) = '" & Format([cboPostingDate], "yyyymm") & "'")
i keep getting #error in my text box

i'm struggling to find they answer to why

the query July 09 - On Billings and Adjustments Data Query
has fields of

customer Number
posting periood date
Amount

Now i have two combo boxes on my form which the text box should look up

Customer number and Name, are bound to another table

No (for customer Number)
Name ( for customer Name

Customer Listing Table

not linked to July 09 - On Billings and Adjustments Data Query

Is this what causing my error and how do i fix it

Thanks in advanced

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

The above assumes that cboCustomerNumber and cboPostingDate contain
valid Customer Numbers and valid dates.

I would suspect, from the name of the Query (July 09 etc.), that you
might not have a normalized data structure.
Do you have a different query for each week or day of the week?
 

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