Pass data from a calculated control in one form to another form

  • Thread starter Thread starter Trish
  • Start date Start date
T

Trish

Hey All,
I have a form with a controll that calculated the difference betwee
two dates, the data from this control is required in another form. Ho
can I pass the data to the other form
 
Set the DEFAULT VALUE to [forms]![theotherform]!
[fieldname] in the control (text box?) property.
-----Original Message-----
Hey All,
I have a form with a controll that calculated the difference between
two dates, the data from this control is required in another form. How
can I pass the data to the other form?



------------------------------------------------
 
Trish,
If both forms are open at the same time...
On Form2, you can set the control source of an unbound control:
=Forms!Form1.ControlName

Or you can pass the value on Form1 to Form2 if you open Form2
from a command button on Form1 using the OpenArgs argument:

DoCmd.OpenForm "Form2", , , , , , Me!ControlName

Then, in the Load event of Form2:
If Not IsNull(OpenArgs) Then
[SomeControl] = OpenArgs
End If
 
Hi Fred,

Thanks for the reply, I tried your first suggestion already but i
won't work correctly for my database as the two forms need to be viewe
independant of eachother, and if I scroll through form2 the data is no
updated to reflect the different values in the corresponding records i
form 1.

I just did the calculation again in form2, I don't know if this is th
correct way of doing it but it works fine for my database.

Thanks again
 
Back
Top