#Error Textbox

  • Thread starter Thread starter Alan
  • Start date Start date
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
 
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\#))
 
=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


.
 
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


.
 
Back
Top