Transfer Text between Forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to transfer txt between two forms, I know it looks something like:

Forms![frmName](txtToTransfer)

but I can't put it together, please help. Thanks
 
Hi J,

From the sending form (pushing) it would be something like

Forms!ReceivingFormName!FieldName = Me.FieldName

From the receiving form (pulling) it would be

Me.FieldName = Forms!SendingFormName!FieldName

HTH
Steve C
 
Hi J,

I'm not sure I understand what you mean by the second form's actions. The
entire transfer (push/pull) can be carried out from either form, and all can
be transfered form one event

For example, from form1 you can push the data to form2 after it has been
opened with:

Forms!ReceivingFormName!FieldName1 = Me.FieldName1
Forms!ReceivingFormName!FieldName2 = Me.FieldName2
Forms!ReceivingFormName!FieldName3 = Me.FieldName3
etc.
use the above in your OnClick if that is where code opens form2

or from form 2 you can pull the date from form1

Me.FieldName1 = Forms!SendingFormName!FieldName1
Me.FieldName2 = Forms!SendingFormName!FieldName2
Me.FieldName3 = Forms!SendingFormName!FieldName3
etc.
this could be placed in form2's OnOpen event. There is no need to have both
forms performing data transfer actions, it can all be accomplished from a
single forms event.

HTH
Steve C

JAdams said:
Steve,

I run the one forms action OnClick() how do I run the 2nd forms actions?

Steve Conway said:
Hi J,

From the sending form (pushing) it would be something like

Forms!ReceivingFormName!FieldName = Me.FieldName

From the receiving form (pulling) it would be

Me.FieldName = Forms!SendingFormName!FieldName

HTH
Steve C

JAdams said:
I need to transfer txt between two forms, I know it looks something like:

Forms![frmName](txtToTransfer)

but I can't put it together, please help. Thanks
 
Steve,

I was thinking something different. Thanks for your help...it is working now. \R

Jeff

Steve Conway said:
Hi J,

I'm not sure I understand what you mean by the second form's actions. The
entire transfer (push/pull) can be carried out from either form, and all can
be transfered form one event

For example, from form1 you can push the data to form2 after it has been
opened with:

Forms!ReceivingFormName!FieldName1 = Me.FieldName1
Forms!ReceivingFormName!FieldName2 = Me.FieldName2
Forms!ReceivingFormName!FieldName3 = Me.FieldName3
etc.
use the above in your OnClick if that is where code opens form2

or from form 2 you can pull the date from form1

Me.FieldName1 = Forms!SendingFormName!FieldName1
Me.FieldName2 = Forms!SendingFormName!FieldName2
Me.FieldName3 = Forms!SendingFormName!FieldName3
etc.
this could be placed in form2's OnOpen event. There is no need to have both
forms performing data transfer actions, it can all be accomplished from a
single forms event.

HTH
Steve C

JAdams said:
Steve,

I run the one forms action OnClick() how do I run the 2nd forms actions?

Steve Conway said:
Hi J,

From the sending form (pushing) it would be something like

Forms!ReceivingFormName!FieldName = Me.FieldName

From the receiving form (pulling) it would be

Me.FieldName = Forms!SendingFormName!FieldName

HTH
Steve C

I need to transfer txt between two forms, I know it looks something like:

Forms![frmName](txtToTransfer)

but I can't put it together, please help. Thanks
 
Hi Steve,
I had exactly the same problem and this seems to be the solution.
However, When I PUSH the data it overwrites the first record showing on the
second form.
In the cmdbutton sub that opens the second form I am using

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmCustomer_Complaints"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Followed by the PUSHING Data etc.

What I need is for the second form to be opened at a NEW RECORD.

Can you help?

--
Cheers
Chas

***************
* Spectrum is Green *
***************


Steve Conway said:
Hi J,

I'm not sure I understand what you mean by the second form's actions. The
entire transfer (push/pull) can be carried out from either form, and all can
be transfered form one event

For example, from form1 you can push the data to form2 after it has been
opened with:

Forms!ReceivingFormName!FieldName1 = Me.FieldName1
Forms!ReceivingFormName!FieldName2 = Me.FieldName2
Forms!ReceivingFormName!FieldName3 = Me.FieldName3
etc.
use the above in your OnClick if that is where code opens form2

or from form 2 you can pull the date from form1

Me.FieldName1 = Forms!SendingFormName!FieldName1
Me.FieldName2 = Forms!SendingFormName!FieldName2
Me.FieldName3 = Forms!SendingFormName!FieldName3
etc.
this could be placed in form2's OnOpen event. There is no need to have both
forms performing data transfer actions, it can all be accomplished from a
single forms event.

HTH
Steve C

JAdams said:
Steve,

I run the one forms action OnClick() how do I run the 2nd forms actions?

Steve Conway said:
Hi J,

From the sending form (pushing) it would be something like

Forms!ReceivingFormName!FieldName = Me.FieldName

From the receiving form (pulling) it would be

Me.FieldName = Forms!SendingFormName!FieldName

HTH
Steve C

I need to transfer txt between two forms, I know it looks something like:

Forms![frmName](txtToTransfer)

but I can't put it together, please help. Thanks
 
Back
Top