Compare values

  • Thread starter Thread starter Ivor Williams
  • Start date Start date
I

Ivor Williams

I have a form with a subform. In the main form is a textbox (txtMainText)
which displays a number. In each record of the subform is a textbox
(txtSubText) which displays a number. What I want to do is compare the
values in txtSubText in each record. If all the values are the same, I want
to have this value displayed in txtMainText, otherwise display a different
number in txtMainText. How can I do this?

Ivor
 
Ivor,
In the Declaratives Code:
Dim frmParent as Form

In FormLoad Event code:
Set frmParent = Me.Parent.Name

Any code in the subform can now access the main form field
as:
frmParent!txtMainText

Ron
 
Back
Top