Date in DSum from a Control on a Form

S

SAC

Access 2003

Having trouble getting a dsum in a query to work correctly.

I have a form with a control, txtCE, on it formatted as a short date.

I have "5/1/10" entered in the control

I then have a query with one column like this: CE: [Forms]![frmARAging-2-Prelim]![txtCE]. This show correctly when I run the query.

Then I have a column in the query with a dsum like this: C: DSum("DebitAcct","ARINH","[CustID]=" & [CUSTKEY] & " And [Date] >= " & [CE])

This displays the incorrect amount.

I then change the dsum to C: DSum("DebitAcct","ARINH","[CustID]=" & [CUSTKEY] & " And [Date] >= #5/1/10#") and this displays the correct amount.

What can I change to make it work correctly?

Thanks for your help.
 

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