I accidentally started a similar thread on the Forms forum.
In AC97, I need help getting a previous balance into a report.
I have a table tblBeltScales, with sample data as follows:
WeightDate B1Belt B2Belt StackingTubeAdjustment
10/21/07 600 200 0
10/22/07 300 100 50
10/23/07 500 250 0
10/23/07 700 800 0
In the report I want to show the following when the report is run from 10/22/07 to 10/23/07 (assume there was no inventory before 10/21/07).
Beginning Stacking Tube Ending
Date Inventory B1Belt B2Belt Adjustments Inventory
10/22/07 400 300 100 0 600
10/23/07 600 500 250 50 900
10/23/07 900 700 800 0 800
Where Ending Inventory = Beginning Inventory + B1Belt - B2Belt + StackingTubeAdjustment
I'm using form frmStackingTubeInventoryReport to select the start and end dates for the report. It has a toggle button with event procedure
I'm using the following query qryStackingTubeInventory to get the B1Belt, B2Belt, and Adjustment values for the report.
The above will get the B1Belt, B2Belt, and StackingTubeAdjustment, and the Ending Inventory is calculated in the report OK.
I have the following query named "tblBeltScales Query" that will get me the beginning inventory.
However, I can't figure out how to get the "Balance" into the report for the "Beginning Inventory", particularly for the 1st day shown on the report.
I've tried a text box tbxBalance in the report for the beginning inventory with a control source
but I get the message "Enter Parameter Value tblBeltScales Query"
Do I need to combine the queries into one somehow so I can select Balance, WeightDate, B1Belt, B2Belt, and StackingTubeAdjustment all from the same query for the control source of tbxBalance, tbxB1Belt, tbxB2Belt, tbxStackingTubeAdjustment, and tbxWeightDate?
Any suggestions?
Thanks,
Brian
In AC97, I need help getting a previous balance into a report.
I have a table tblBeltScales, with sample data as follows:
WeightDate B1Belt B2Belt StackingTubeAdjustment
10/21/07 600 200 0
10/22/07 300 100 50
10/23/07 500 250 0
10/23/07 700 800 0
In the report I want to show the following when the report is run from 10/22/07 to 10/23/07 (assume there was no inventory before 10/21/07).
Beginning Stacking Tube Ending
Date Inventory B1Belt B2Belt Adjustments Inventory
10/22/07 400 300 100 0 600
10/23/07 600 500 250 50 900
10/23/07 900 700 800 0 800
Where Ending Inventory = Beginning Inventory + B1Belt - B2Belt + StackingTubeAdjustment
I'm using form frmStackingTubeInventoryReport to select the start and end dates for the report. It has a toggle button with event procedure
I'm using the following query qryStackingTubeInventory to get the B1Belt, B2Belt, and Adjustment values for the report.
Code:
SELECT tblBeltScales.B1Belt, tblBeltScales.B2Belt, tblBeltScales.StackingTubeAdjustment
FROM tblBeltScales
WHERE DateValue([tblBeltScales].[WeightDate]) Between
[Forms]![frmStackingTubeInventoryReport]![tbxStartDate] And
([Forms]![frmStackingTubeInventoryReport]![tbxEndDate]);
The above will get the B1Belt, B2Belt, and StackingTubeAdjustment, and the Ending Inventory is calculated in the report OK.
I have the following query named "tblBeltScales Query" that will get me the beginning inventory.
Code:
SELECT Sum(nz([B1Belt],0)-nz([StackingTubeAdjustment],0)-nz([B2Belt],0)) AS Balance
FROM tblBeltScales
WHERE DateValue([tblBeltScales].[WeightDate]) < ([Forms]![frmStackingTubeInventoryReport]![tbxEndDate]);
However, I can't figure out how to get the "Balance" into the report for the "Beginning Inventory", particularly for the 1st day shown on the report.
I've tried a text box tbxBalance in the report for the beginning inventory with a control source
Code:
=[tblBeltScales Query]![Balance]
but I get the message "Enter Parameter Value tblBeltScales Query"
Do I need to combine the queries into one somehow so I can select Balance, WeightDate, B1Belt, B2Belt, and StackingTubeAdjustment all from the same query for the control source of tbxBalance, tbxB1Belt, tbxB2Belt, tbxStackingTubeAdjustment, and tbxWeightDate?
Any suggestions?
Thanks,
Brian