View Full Version : how to apply Dsum function in the module


lynn
08-01-2000, 04:29 PM
ohayogozaimasu....

i had one more problem. I had a form taht would calculate the sum of field in the table according to the date that will be enter in the form.I had 2 kind of date, the beginning date and the ending date.The calculation will be between those date. my problem is that, i tried to write the code in the module but it won't work, but i tried it in the report, it works. i think something wrong with the coding, i hope anybody can help me, below are the coding, the event is when i click the calculation button, it will calculate and show the result in the text box,

Me!txtGrandTotal.value = DSum("AmountApproved", "tblApproval", _
"DateUpdated between ' " & Me![txtBeginningDate] & " ' and ' " & Me![txtEndingDate] & "'")

domo arigato gozaimasu

Pat Hartman
08-01-2000, 06:28 PM
You have the dates surrounded by single quotes. They need to be surrounded by pound signs (#).

lynn
08-01-2000, 07:41 PM
i still do not understand....can you please show me the example......