My Assistant
![]() ![]() |
|
|
Mar 26 2008, 01:53 AM
Post
#1
|
|
|
UtterAccess Addict Posts: 173 |
hi all
am trying to calculate three textbox and to be shown in another text box unitesreceived = Quantity+Extra-shortage note that all the for fields are in the same table i want the user to enter the first three fields and and then unites received will show the result of the calculation thanks |
|
|
|
Mar 26 2008, 03:24 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 3,881 From: New Zealand |
Datto,
The unitesreceived field should not be in the table. It is not necessary to store this figure in the database, since it is derived from the values in the other fields. In fact it is a bad idea. On your form, put an unbound textbox. And then in its Control Source, enter your calculation expression, like this: =[Quantity]+[Extra]-[Shortage] If you have Default Value of 0 for the Quantity and Extra and Shortage fields, this should work well. If there is a possibility that any of these fields will be empty (Null), then you would need to make provision for that. |
|
|
|
Mar 26 2008, 03:40 AM
Post
#3
|
|
|
UtterAccess Addict Posts: 173 |
thanks for replying
i did that but it doesn't add instead it bind ex 10 +1 =101 any idea ? thanks |
|
|
|
Mar 26 2008, 03:52 AM
Post
#4
|
|
|
UtterAccess VIP Posts: 3,881 From: New Zealand |
Datto,
That would indicate that one (or more) of the fields is Text data type, instead of Number. |
|
|
|
Mar 26 2008, 05:01 AM
Post
#5
|
|
|
UtterAccess Addict Posts: 173 |
oh that is great ,,u r right ,sorry
done thanks for help |
|
|
|
Mar 26 2008, 07:49 AM
Post
#6
|
|
|
UtterAccess VIP Posts: 1,420 From: NV |
Hi,
What I would sugest is to add QtyOrdered and remove Extra and Shortage and have calculated value in query based on tblTransactions as such: Extra/Shortage:IIf([QtyOrdered]<[QtyReceived],([QtyReceived]-[QtyOrdered]),([QtyReceived]-[QtyOrdered])) Also you have prvyear in tblPRV which is redundant and can be calculated for report purpose by Year: Format([PrvDate],"yyyy") TransactionDate in tblTransactions does not belong there. You already have PrvDate in tblPRV. Also ItemDescription doesn not belong in tblTransactions. You already have ProductID. Base all your forms on saved queries where you can add calc.fields as I mentioned above. You can also add subtotal cost per line and grans total to to child frm footer and carry this value to parent form with proper expression. HTH |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 21st May 2013 - 09:59 AM |