Calling a field from another subform

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

Guest

Onclick event - copies data from one field on one from into another field on
a different form.

Main Form - Potential
Two subforms in Main Form (using tab control)
Subform 1 - FinanceInfoSubForm
Subform 2 - ServicesInfoSubForm
The button is in FinanceInfoSubForm. When I click it, it takes data from a
field in ServicesINfoSubForm called (control source) - CancellationFee. When
you click this button, it takes that info and puts it into a field called
(control source) CancellationFeeAmt in FinanceInfoSubForm.

The is what I have tired & doesn't work:

Me.CancellationFeeAmt = Me!ServicesInfoSubForm.Form.CancellationFee
Me.CancellationFeeAmt = Me!ServicesInfoSubForm.Form!CancellationFee
Me.CancellationFeeAmt = Me!ServicesInfoSubForm.CancellationFee
Me.CancellationFeeAmt = Me!ServicesInfoSubForm!CancellationFee

Thanks
Curtis
 
It should be:
Me.CancellationFeeAmt =
Forms.Potential.ServicesInfoSubForm.Form!CancellationFee

Good luck.
 
It should be:
Me.CancellationFeeAmt =
Forms.Potential.ServicesInfoSubForm.Form!CancellationFee


Anyway possible to avoid placing Potential in there? I have several copies
of this same form, like Potential, Active, All, etc. Which lists customers
using querys, like only potential customers, active ones, and all, entire
database list. I don't want to have to go in and edit this line for every
field as I'm always updating it, so I have to recreate the other two copies &
edit a few other lines already, don't want anymore to have to change when I
make a new version, etc.

Thanks
Curtis
 
Put the button in the MainForm and paste this to On Click event:
Me.FinanceInfoSubForm.Form!CancellationFeeAmt =
Me.ServicesInfoSubForm.Form!CancellationFee
Note that if you put the button in a subform, the Me will refer to that form
only, not the main form, so if you want to have multi-copies of this form,
the alt way is to put it in the main form.
Bsrg.
 
Back
Top