Field on Form

W

Wayne Veale

I have afld on a form I call slsamt. I have a defult vale of 0 in he field.
I set the valdidation rule to >0 validation text to Amt Must Be GT zero.
When I execute the form, If I enter a zero in the field the validation rule
works fine, but when I tab past the field and exit the form the validation
rule does not work. Is there a way to force the user to put an amount GT
zero in this field even though they may TAB past it?
Thanks, I have been struggling with this far to long.
WWV
 
A

Allen Browne

In the lower pane of table design, set the Required property of the field to
Yes.

The user can now fill in the fields in any order they want, but they can't
save the record until they enter a value for this field.
 
W

Wayne Veale

Hi Allen, I tried this and the form still does not stop it continues to add
the record. More detail:
On the form -- format=STD, DEC=2, input mask=>0,Valid rule=>0, Valid text=
"MB GT 0", this did not work. I than added the change to the table --
Required=Yes, Did not work. After the "close form" button (ON CLOSE) I run 4
macros whic do updating tbls . I'm using ACCESS 2003. thanks
(frustrated) WWV
 
A

Allen Browne

Wayne, if you set the Required property of the field to Yes, you will not be
able to save the record where the field is null.

If the field is a Number field, and has a Default Value of zero, perhaps it
is saving the zero (i.e. it does have a value.)

If the field is a text field, make sure it is not a zero-length string.
(Best to set Allow Zero Length to No.)

Note that you will be able to tab through the box without triggering a
message, but the record will not save.

Also, if you programmatically close the form (with code or a macro), you
will not get an error messsage, but the record will not save.

Not sure what your macros are doing. If they use RunSQL or OpenQuery, and
you turn SetWarnings off, you will get no message if the record does not
save: again it will silently fail to save the record if there is no value.
 
W

Wayne Veale

Thanks, another question. I have a form that I enter data into a fld salamt.
I also want to put the same amount into another field in the same table
(same form) called slsamtb. How can I do this? I have tried controlled
source on properties but no luck. Having a bad week. WWV
 

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