Compare values

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
 
R

Ron

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
 

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