#Error Textbox

A

Alan

=DSum("[Value]","Billings Analysis","[CustomerNo] = '" & [cboCustomerNumber]
& "' AND [Posting DatePeriod] = '" & [cboPostingDate] & "'")

Right i used this code in the source code of my textbox and the textbox
keeps flashing, i click on it an it says #ERROR

am i moving forward ?? lol
 
D

Douglas J. Steele

If Posting DatePeriod is a date field, you need to use # delimiters:

=DSum("[Value]","Billings Analysis","[CustomerNo] = '" & [cboCustomerNumber]
& "' AND [Posting DatePeriod] = #" & [cboPostingDate] & "#")

In fact, you're best off using

=DSum("[Value]","Billings Analysis","[CustomerNo] = '" & [cboCustomerNumber]
& "' AND [Posting DatePeriod] = " & Format([cboPostingDate],
"\#yyyy\-mm\-dd\#))
 
A

Alan

=DSum("[Value]","Billings Analysis","[CustomerNo] = '" & [cboCustomerNumber]
& "' AND [Posting DatePeriod] = " & Format([cboPostingDate],
"\#yyyy\-mm\-dd\#))

This gives me a invalid string #error


Douglas J. Steele said:
If Posting DatePeriod is a date field, you need to use # delimiters:

=DSum("[Value]","Billings Analysis","[CustomerNo] = '" & [cboCustomerNumber]
& "' AND [Posting DatePeriod] = #" & [cboPostingDate] & "#")

In fact, you're best off using

=DSum("[Value]","Billings Analysis","[CustomerNo] = '" & [cboCustomerNumber]
& "' AND [Posting DatePeriod] = " & Format([cboPostingDate],
"\#yyyy\-mm\-dd\#))

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

Alan said:
=DSum("[Value]","Billings Analysis","[CustomerNo] = '" &
[cboCustomerNumber]
& "' AND [Posting DatePeriod] = '" & [cboPostingDate] & "'")

Right i used this code in the source code of my textbox and the textbox
keeps flashing, i click on it an it says #ERROR

am i moving forward ?? lol


.
 
D

Daryl S

Alan -

Missing a double-quote at the end of the date formatting. Try this:

=DSum("[Value]","Billings Analysis","[CustomerNo] = '" & [cboCustomerNumber]
& "' AND [Posting DatePeriod] = " & Format([cboPostingDate],
"\#yyyy\-mm\-dd\#"))

--
Daryl S


Alan said:
=DSum("[Value]","Billings Analysis","[CustomerNo] = '" & [cboCustomerNumber]
& "' AND [Posting DatePeriod] = " & Format([cboPostingDate],
"\#yyyy\-mm\-dd\#))

This gives me a invalid string #error


Douglas J. Steele said:
If Posting DatePeriod is a date field, you need to use # delimiters:

=DSum("[Value]","Billings Analysis","[CustomerNo] = '" & [cboCustomerNumber]
& "' AND [Posting DatePeriod] = #" & [cboPostingDate] & "#")

In fact, you're best off using

=DSum("[Value]","Billings Analysis","[CustomerNo] = '" & [cboCustomerNumber]
& "' AND [Posting DatePeriod] = " & Format([cboPostingDate],
"\#yyyy\-mm\-dd\#))

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

Alan said:
=DSum("[Value]","Billings Analysis","[CustomerNo] = '" &
[cboCustomerNumber]
& "' AND [Posting DatePeriod] = '" & [cboPostingDate] & "'")

Right i used this code in the source code of my textbox and the textbox
keeps flashing, i click on it an it says #ERROR

am i moving forward ?? lol


.
 

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