Jass Saini
asked on
Help with Calculation on the third form
On form B, I have a field that is a calculation based in a query....I have no problems. My third form is where I am having problems. Can I refer formB.FieldTotal2 and use it in formC.FieldBegTotal3
So here is what I am trying to do
Final_frm2 Final_frm3 Final_frm4
BegTotal-->TotalBC2 TotalBC2-->TotalBC3 TotalBC3-->TotalBC4
These fields began with a calculations.....
So here is what I am trying to do
Final_frm2 Final_frm3 Final_frm4
BegTotal-->TotalBC2 TotalBC2-->TotalBC3 TotalBC3-->TotalBC4
These fields began with a calculations.....
JAss SAini,
<Just FYI, No points wanted>
What Rey posted is the exact same syntax as was used in your previous question(s)
So see this link for info on referencing form controls...
http://access.mvps.org/access/forms/frm0031.htm
JeffCoachman
<Just FYI, No points wanted>
What Rey posted is the exact same syntax as was used in your previous question(s)
So see this link for info on referencing form controls...
http://access.mvps.org/access/forms/frm0031.htm
JeffCoachman
ASKER
So my field is not bound to my table...Also that does not work for me and I am not sure why
<Also that does not work for me and I am not sure why >
so are we.. you, can see what you did and you are sure why it is not working, how do you expect us to give comments without seeing what you did..
so are we.. you, can see what you did and you are sure why it is not working, how do you expect us to give comments without seeing what you did..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes..these are subforms...
The first subform refers back to a field on the table...No problem. I have no issues with that.
Second subform...I used a calculation in query..here is that
Beg Total for form 2
BegTotal: Nz([Final_Table].[Total Initial],0)+Nz([BC1Chng1], 0)+Nz([BC1 Chng2],0)+ Nz([BC1Chn g3],0)+Nz( [BC1Chng4] ,0)+Nz([BC 1Chng5],0) +Nz([BC1Ch ng6],0)+Nz ([BC1Chng7 ],0)+Nz([B C1Chng8],0 )+Nz([BC1C hng9],0)+N z([BC1Chng 10],0)
End total for Form 2
TotalBC2: Nz([BegTotal],0)+Nz([BC2Ch ng1],0)+Nz ([BC2Chng2 ],0)+Nz([B C2Chng3],0 )+Nz([BC2C hng4],0)+N z([BC2Chng 5],0)+Nz([ BC2Chng6], 0)+Nz([BC2 Chng7],0)+ Nz([BC2Chn g8],0)+Nz( [BC2Chng9] ,0)+Nz([BC 2Chng10],0 )
This is not causing me an issue either
The third form Beginning Total should be form 2 end total:
BegTotal3: Nz([Final_Table Query2].[BegTotal],0)+Nz([ BC2Chng1], 0)+Nz([BC2 Chng2],0)+ Nz([BC2Chn g3],0)+Nz( [BC2Chng4] ,0)+Nz([BC 2Chng5],0) +Nz([BC2Ch ng6],0)+Nz ([BC2Chng7 ],0)+Nz([B C2Chng8],0 )+Nz([BC2C hng9],0)+N z([BC2Chng 10],0)
When I run the query..it is asking me to supply the Parameter Value for Final_Table Query2.BegTotal.
The box says to "Enter Parameter Value" and it says the field name.
My query are named Final_Table Query2 and Final_Table Query3 respectively. The subform are called fsub_Final_Table Query2 and Query3 respectively.
Hope this helps..I have tried every different combination (subform name and query name) and each time it ask me to enter the parameter value
The first subform refers back to a field on the table...No problem. I have no issues with that.
Second subform...I used a calculation in query..here is that
Beg Total for form 2
BegTotal: Nz([Final_Table].[Total Initial],0)+Nz([BC1Chng1],
End total for Form 2
TotalBC2: Nz([BegTotal],0)+Nz([BC2Ch
This is not causing me an issue either
The third form Beginning Total should be form 2 end total:
BegTotal3: Nz([Final_Table Query2].[BegTotal],0)+Nz([
When I run the query..it is asking me to supply the Parameter Value for Final_Table Query2.BegTotal.
The box says to "Enter Parameter Value" and it says the field name.
My query are named Final_Table Query2 and Final_Table Query3 respectively. The subform are called fsub_Final_Table Query2 and Query3 respectively.
Hope this helps..I have tried every different combination (subform name and query name) and each time it ask me to enter the parameter value
ASKER
I just tried putting =[Forms]![fsub_Final_Table Query2]![TotalBC2] in the BegTotal3 control source. It does return a value..but the value is returns is the first value in that field for all the records..meaning it is returning the same value in the entire form
Is the "Final_Table Query2" table part of your query?
If BegTotal a calculated field?
If BegTotal a calculated field?
ASKER
Sorry ....Final_table Query2 is a query....
I am trying to do all the calculation within the query..as I was told it's not good practice to have a calculated field in the table.
I am trying to do all the calculation within the query..as I was told it's not good practice to have a calculated field in the table.
ASKER
Yes ..BegTotal is calculated field.
BegTotal: Nz([Final_Table].[Total Initial],0)+Nz([BC1Chng1], 0)+Nz([BC1 Chng2],0)+ Nz([BC1Chn g3],0)+Nz( [BC1Chng4] ,0)+Nz([BC 1Chng5],0) +Nz([BC1Ch ng6],0)+Nz ([BC1Chng7 ],0)+Nz([B C1Chng8],0 )+Nz([BC1C hng9],0)+N z([BC1Chng 10],0)
BegTotal: Nz([Final_Table].[Total Initial],0)+Nz([BC1Chng1],
When I run the query..it is asking me to supply the Parameter Value for Final_Table Query2.BegTotal.This normally means you've misspelled a Table or Field name, or you're trying to refer to a Table or Field that is NOT part of the Query.
The box says to "Enter Parameter Value" and it says the field name.
If you run the query in the query designer, do you still get the prompt?
ASKER
Do you mean in design view?? Yes I still get the same prompt. The field is in a subform...
ASKER
That's okay..I did the calculation based off the one field in the table..Thanks for your help
ASKER
Thanks..I used the long way to get my calculations
Forms!NameOfForm.Controlna
so in form "Final_frm3", you can do this
me.TotalBC3= Forms!Final_frm2.TotalBC2
now you just have to figure out the events that you need
try using the Form's Load Event and/or Form's Current event