How to program expression builder of a textbox?

nate0057

Registered User.
Local time
Today, 14:42
Joined
Oct 4, 2012
Messages
74
Hi,

I have this following problem:

I want to pogram a textbox. In the expression builder of the properties sheet's control source I've programmed this following code:

=IIf([word1] Or [word2]=1,1,0)

It works. But I have to add 37 other "words" and I can not.

I tried:

=IIf([word1] Or [word2]=1,1,0) or =IIf([word3] Or [word4]=1,1,0) Or....

But it doesn't work.

Could someone help me??

Thank you.
 
First, you need to explicitly do the comparison to every word like this:

=IIf([word1]=1 Or [word2]=1,1,0)

Second, 1 isn't a word. Are all those wordx fields numeric or characters?

Third, tell me that you don't have 37 fields in your table named numerically (i.e. word1, word2, etc.)

Fourth, you haven't given me enough information to tell you what the simpliest way is. I am sure it will involve putting all those words in a table and creating a query, possibly it might involve some VBA. But the way you want to go about it, probably isn't the most effective. More specific information please.
 
sorry it's not 37 other values but just 3 others and all of these are characters.
Could you help me?
 
Last edited:
Words are some requirements.
The goal of this textbox is to be red if the word is true (=1)
In the conditionnal formatting of this textbox I add the rule : If Field value is equal to 1 textbox is coloured in red.

Now in the control source of this texbox, I used this code :
=Iif([BLUP]=1 or [PSW]=1,1,0). (BLUP and PSW are 2 of the requirements.)

It's work, the the texbox is red because BLUP=1
I just need to know how added the 3 others.
 

Users who are viewing this thread

Back
Top Bottom