Solved DSum quantities based on a text date box.

Chief

Registered User.
Local time
Today, 09:23
Joined
Feb 22, 2012
Messages
156
Hello,
I am trying to sum all of the sheets cut on a date which is picked on a form.

Form:
1638162814436.png

Query
1638162855951.png


SQL:
SELECT JobInfoT.JobID, JobInfoT.CarcassCut_Due, JobInfoT.CarcassCut_Date, JobInfoT.CC_Sheets
FROM JobTypesT INNER JOIN JobInfoT ON JobTypesT.JobTypeID = JobInfoT.JobTypeID
WHERE (((JobInfoT.CarcassCut_Date)=[Forms]![ManufSubF]![TxtDateFilter]));

And the Field where it should be adding them all up: (CC_Cut on the form)
=Nz(DSum("CC_Sheets","CC_SheetsCutQ","[CarcassCut_Date] = [TxtDateFilter]"))

Thanks :)
 
use can either use American date or ISO date plus the # delimiter:

=Nz(DSum("CC_Sheets","CC_SheetsCutQ","[CarcassCut_Date] = #" & Format$([TxtDateFilter], "mm/dd/yyyy") & "#"))
 
use can either use American date or ISO date plus the # delimiter:

=Nz(DSum("CC_Sheets","CC_SheetsCutQ","[CarcassCut_Date] = #" & Format$([TxtDateFilter], "mm/dd/yyyy") & "#"))
G'day mate,

I get a #Name? error

1638229519167.png
 
#Name? usually indicates a typo. Double check your spellings.
 
Hopefully someone can assist 🙏

Trying to update and load today :D
 
Hopefully someone can assist 🙏

Trying to update and load today :D
If you need immediate help, you might consider posting a sample copy of your db with test data.
 
is this what you meant?
 

Attachments

in the sample database the fields are blank.
in my database the field is error.

1638241398685.png
 
your query is based on the date textbox on the form.
the expression i made (on table) is also based on the date textbox.
 
is this what you meant?
your query is based on the date textbox on the form.
the expression i made (on table) is also based on the date textbox.
your query is based on the date textbox on the form.
the expression i made (on table) is also based on the date textbox.
Ok, cool.
Looks like it is working :) Thank you so much.

What's the best way to make this refresh?
Form event?
or an event on TxtDateFilter

Im Finding i select the date.
tab out (Not what i want to do)
but have to click back in date field to make numbers work.
 
if you change the txtDateFilter, the two textbox will compute automatically
so no need to refresh the two textbox or the form.
 
if you change the txtDateFilter, the two textbox will compute automatically
so no need to refresh the two textbox or the form.
Unfortunately that's not working for me.
i have to click out of the date field and alot of the time have to click in the calculated fields for the numbers to appear.
The calculated fields I will be making not enabled/locked.
Users wont understand or get the wrong figures when changing date.
 
after entering new date, press Enter key and the textbox will refresh.
 
you can try adding a Button to Requery those 2 total textbox.
 

Attachments

Users who are viewing this thread

Back
Top Bottom