Opening Stock balances

Hi Experts

Sorry people may be I mislead you. All what I want is how to include a productID range within Dsum

Dsum(“Closing”,”QryOpFinalstocks”,” [ProductID] = “ & Forms![<formname>]![<controlName>]& “ And [Warehouse ID] = “& Forms![<formname>]![<controlName>]& “ And [PPDate] <= “#& Forms![<formname>]![<controlName>]& “ #” )

I need that so that the selected code from the form query are picked correctly

How do we insert a product ID range in the above code??????????????


Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScDirectorAsked:
Who is Participating?
Bill PrewCommented:
If I understand correctly, you want to include a range of ProductID's.  If so then try as below.  Adjust the >= and <= related to ProductId as needed.

This assumes that ProductId and Warehouse ID are numeric types in the database, not strings.

I also noticed that you had the wrong type double quotes (word processing style) in your post, but that may have been cut and paste result.

Also it looked like the # concatenation at the end field was a little off, I corrected that I believe.

Dsum("Closing", "QryOpFinalstocks", " [ProductID] <= " & Forms![<formname>]![<controlName1>] & " [ProductID] >= " & Forms![<formname>]![<controlName2>] & " And [Warehouse ID] = " & Forms![<formname>]![<controlName3>] & " And [PPDate] <= #" & Forms![<formname>]![<controlName4>] & "#")

Open in new window


Appears the original question was not solved.

Perhaps this question should be re-opened?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.