|
Answer» In a previously designed database, I made fields required by setting the Validation Rule to the [first name] field to Is not null and the Validation Text to "Please enter a first name." I didn't want to use Required = Yes because it gives the user a message that is too technical. This method worked just fine. When the user clicked on the command button to close the form, the above messages would pop up if the field was left blank.
I've tried the same method in a database currently being designed and it's not working. Nothing happens when the user clicks on the close button.
I don't KNOW if this makes a difference but in the first database, the field REQUIREMENTS were on a subform. In the second, the requirements are on a main form not connected to anything else. Also, the first database was done using Access 2000 and the second, Access 2003.
Does anyone have any suggestions as to why this isn't working or suggest an alternate way of making the fields required?
Thanks in advance for any help.Don't really have enough details as to why the original database behaved as it did. What type of relationship did the TABLES have? Was referential integrity enforced? etc.
You can put some VBA code behind the update command button. If you use the _BeforeUpdate event, you can catch all fields in error, put up a polite message and prevent any garbage data from entering the database. Not sure why you would edit fields when the user closes the form.
Good LUCK.
|