How to make a text box "required"

NoSmoke

Registered User.
Local time
Today, 10:39
Joined
Nov 10, 2012
Messages
99
I know how to make a text box entry "required" such that one cannot exit a record until a value is entered but cannot figure out how to make it required only if another field on the form has an entry. None of the form events seem to support that when focus moves to another record as far as I can tell. What I want to do is display an error message if the condition is not met on exiting a record but to also remain on (or go back to) that record so the required text box entry can then be made.

Can anyone please help with this??
 
Thanks Paul, I will give that a try!
 
Hey Paul, tried it and it works as advertised but I've found that either the "Cancel = True" or the set focus statement in your example keep it to the current record (after the error message is cleared) i.e. the Cancel = True does not seem to be required. Not a problem, just an observation.

But, I have also found that the Before Update event, or code therein, seems to create an OnError condition which triggers in a macro I also have for the form (that displays an error message if other fields set to "Required" in the table's field properties have no entries, but in this case displays even when they all do have entries). I therefore get two error messages when the Before Update event conditions are not met - the one for the Before Update followed by the one for fields Required macro. I have tried "OnError = True" and "OnError = False" in the Before Update code but with no effect. Any suggestions on how to suppress the false Required fields message??
 

Users who are viewing this thread

Back
Top Bottom