General discussion

Locked

Form Properties from a Table in Access97

By frankus ·
What is the simplest way to make a property of a textbox (input box) in a form dependent on the value in a field in a table record.
Example: I want the background color of certain input boxes to be yellow when field entry is true in a corresponding field (say a yes/no field or checkbox).
Can the object property be made dependent on a field withou having to do an IF in code?

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Form Properties from a Table in Access97

by Ktirf In reply to Form Properties from a Ta ...

You can specify the value of a property as an expression, when you construct the form. Instead IF, there's a pleasant function IIf(), which evaluates the first argument and depending on the result substitutes either with the second arg (if 1st is true), or the third (if it is false). Thus, the value for the property will look like
=IIf(tablefield,yellow,white)
(don't forget '=' in the beginning)
I might mistake ',' instead of ';' between args. Try both. And replace the args with something sensible, of course
Cheers!

Collapse -

Form Properties from a Table in Access97

by frankus In reply to Form Properties from a Ta ...

Poster rated this answer

Collapse -

Form Properties from a Table in Access97

by frankus In reply to Form Properties from a Ta ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums