Don't save record when fields are empty?

kbrooks

Still learning
Local time
Yesterday, 18:53
Joined
May 15, 2001
Messages
202
I'm sure this is simple but I can't get it to work.

I have a table called Charges where the user inputs data into 5 fields via a form. The form is in tabular view, where each line is a new record. The problem is that they get overzealous when tabbing from field to field, and start a new record without meaning to. The first field (account#) will duplicate from the previous record. This is no problem if they have another record they need to add, but if they don't, and they close the database, it saves a new record with an account# but all other fields are blank. It doesn't happen a LOT, but it does happen and I'd like to avoid it.

On a similar database, I set all fields as required, thinking that would solve my problem. It does to the extent that it won't let me close the database without filling in all required fields. But if I have no other records to add, there's nothing to fill in except garbage just to let the form close.

Easy solutions? TIA!
 
An easy solution is to go to Options from the Tools menu - then select "Cursor stops and first/last field". This should prevent the user from accidentally tabbing to the next record.

But, if a user thinks they want to add a record, purposely move to a new record and then decide they don't want to add it, they will be able to save an essentially blank record unless you place code in the Before Update event of the form to prevent this.
 

Users who are viewing this thread

Back
Top Bottom