Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Verifying a field is filled, and not letting move on until it is

Status
Not open for further replies.

avivit

Technical User
Jul 5, 2000
456
IL
I am checking if a field is null on form_beforeUpdate event.
if it's null, I am alerting in using msgBox and set focus to the same field.

I would like to keep alerting it until this field is filled out. The problem is that after one msg, the user can still move on to the next record, for the "form_beforeUpdate" does not happen again (because no further action has been made by user after my msgBox, just moving on).
Also msBox on lostFocus event of that specific field (in addition to the form_beforeUpdate) is not good, for it happens only when looses focus: Still the user can ignore the msg and move on.

I also tried to handle it on the specific field before_update, and it did not work good enough.

What shall I do in order to keep notifying the user a field is missing (and letting him fill it in, not enter into an endless loop of msgs... :) )
I do not want to allow the user to leave this form without this field filled out, and I want him to fill it in when he's leaving the record, not when he's leaving the whole form after many records such as that can be empty).

Thanks
 
Hi!

Go to the table where the field is and set the Required property to yes. Now Access will not add the record until that field has data. If the field is numerical and you do not want to allow the zero you will need to set a validation rule <> 0 as well. If the field is text and you do not want to allow and empty string, then you need to set the Allow Zero Length to no. After that, you will need to delete your control and remake it for that field so the information from the table is attached to the control on the form.

hth
Jeff Bridgham
 
Well truely I forgot there is such a simple solution as u mentioned. :)
On the other hand, I hate that &quot;required&quot; thing, it is very annoying, for you can't even delete the record if the required field is null, unless you fill it in.
And also, sometimes (I can;t figure out when exactly), when u move from this required field to another field in that same record, u also get this annoying not friendly.
I'd like to avoid that...

Thanks fpr the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top