How to use a calculated value from one form in another form?

  • Thread starter Thread starter tom
  • Start date Start date
T

tom

I have a value on formA text box

=sum(cost)

I want to use this value in formB that I open from formA.

How do I reference this text box in formB?
 
I have a value on formA text box

=sum(cost)

I want to use this value in formB that I open from formA.

How do I reference this text box in formB?

FormName!ControlName!Text
 
I have a value on formA text box

=sum(cost)

I want to use this value in formB that I open from formA.

How do I reference this text box in formB?

I use an event in the "on open"

Me.[FormBBoxname] = [Form]![FormA]![FormABoxname]

or you could set the default value = [Form]![FormA]![FormABoxname]

I am Tom Too!
 
For example in formB, I have a function call

function(a,b,=[Forms]![formA]![TextBoxName])

I think this is not working.

Dennis said:
=[Forms]![formA]![TextBoxName]

tom said:
I have a value on formA text box

=sum(cost)

I want to use this value in formB that I open from formA.

How do I reference this text box in formB?
 
I have a value on formA text box

=sum(cost)

I want to use this value in formB that I open from formA.

How do I reference this text box in formB?

You don't need to do so. Just recalculate it based on the data in the table.
That will be just as fast as having the form do the calculation, or much
faster if it's necessary to open FormA.

If you *KNOW* that FormA will be open, and you *KNOW* that it will be
positioned at the right record, you can use

=Forms!FormA!Controlname

as the control source of a textbox on FormB.
 
For example in formB, I have a function call

function(a,b,=[Forms]![formA]![TextBoxName])

I think this is not working.

Leave off the = sign; that's needed when you're using the expression as the
control source of a textbox (to tell Access that it's an expression), but it's
incorrect syntax in a function parameter.
 
I am using a recordsource for the new form that does not
have the data to do the calculation. I would prefer your
method, but I am not quite sure how to do it.
 
I am using a recordsource for the new form that does not
have the data to do the calculation. I would prefer your
method, but I am not quite sure how to do it.

Does the data to do the calculation exist in your tables?

If not, is it user input on FormA and only there?

What IS the calculation, and why do you need to do it on two different forms?
 
Back
Top