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

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
 
B

Bonnie

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?



------------------------------------------------
 
F

Fredg

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
 
T

Trish

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top