Date and Total

G

Guest

I have a form where I would like the Admin to confirm the Total Stock from
one done manually.
In this form there is two date fields with names txtOpeningDate and
txtStockDate , command , cmdShow and a txtBox called Total.
txtOpeningDate is locked and shows the date when the store opened.
txtStockDate is where the user inputs the date he wants by selecting it from
a calender. Then clicks cmdShow which in turn runs an SQL statement which
selects the products in between the dates and displays the counted total in
txtBox Total . All this is working well except am getting the wrong count.
The way the store oparates everyitem has a productCode so and there is no
category.
When an item is sold a checkbox called chkOut is checked.
am using this checkbox and datein as criteria
The logic I want is to calculate the number of Items in the shop at any
selected date.
where am I going wrong The SQL is as follows

Dim strSQL As String
strSQL = "SELECT Products.ProductCode, Products.Out, Products.DateIn
FROM Products "
strSQL = strSQL & "WHERE (((Products.Out)<>Yes) AND ((Products.DateIn)
Between [Forms]![StockTake]![txtOpening] And
[Forms]![StockTake]![txtStockDate]));"
' Set RecordSource property of InbyCategory Subform.
Me!StockCount.Form.RecordSource = strSQL
NB StockTake is the main form and StockCount is a continuous subform where
the items are displayed so that I can be able to count the total of
ProductCode.
Any help
 
1

1015di

Muriukis said:
I have a form where I would like the Admin to confirm the Total Stock from
one done manually.
In this form there is two date fields with names txtOpeningDate and
txtStockDate , command , cmdShow and a txtBox called Total.
txtOpeningDate is locked and shows the date when the store opened.
txtStockDate is where the user inputs the date he wants by selecting it
from
a calender. Then clicks cmdShow which in turn runs an SQL statement which
selects the products in between the dates and displays the counted total
in
txtBox Total . All this is working well except am getting the wrong count.
The way the store oparates everyitem has a productCode so and there is no
category.
When an item is sold a checkbox called chkOut is checked.
am using this checkbox and datein as criteria
The logic I want is to calculate the number of Items in the shop at any
selected date.
where am I going wrong The SQL is as follows

Dim strSQL As String
strSQL = "SELECT Products.ProductCode, Products.Out, Products.DateIn
FROM Products "
strSQL = strSQL & "WHERE (((Products.Out)<>Yes) AND ((Products.DateIn)
Between [Forms]![StockTake]![txtOpening] And
[Forms]![StockTake]![txtStockDate]));"
' Set RecordSource property of InbyCategory Subform.
Me!StockCount.Form.RecordSource = strSQL
NB StockTake is the main form and StockCount is a continuous subform where
the items are displayed so that I can be able to count the total of
ProductCode.
Any 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