Compare Values in records

  • 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,

Here's one possibility...
In the form footer of the subform, put an unbound textbox, let's say
you name it EqualityTest, with this ControlSource...
=Max([txtSubText])=Min([txtSubText])
And then, in the ControlSource of txtMainText, put...
=IIf([EqualityTest],[SubformName]![txtSubText],[DifferentNumber])

- Steve Schapel, Microsoft Access MVP
 
Back
Top