Compare Values in records

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
 
S

Steve Schapel

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
 

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