If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back  dBforums > PC based Database Applications > Microsoft Access > Required fields in Access database

LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Registered User
Join Date: Aug 2004
Posts: 48
Required fields in Access database

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.
Reply With Quote
  #2 (permalink)  
Join Date: Jan 2007
Location: UK
Posts: 11,054
When the record saves without failing validation; is the value saved a blank string, or is it a NULL value?

I'm betting it's the former.
Home | Blog
Reply With Quote
  #3 (permalink)  
Jaded Developer
Join Date: Nov 2004
Location: out on a limb
Posts: 12,296
could be

another possible cause of problems is applying such rules inthe db, after the form is created... often the form designer doesn't pull these changed values into the form.
Is taking part in the 'Distinguished Gentlemans' ride. Being neither distinguished nor a gentleman, but I am keen to raise funds for Prostrate Cancer research. At present I'm threatening to ride a Norton 961 wearing a kilt. If you would like to contribute to Prostrate Cancer research then please consider donating via this page:-
Reply With Quote
  #4 (permalink)  
L33t Helpa Munky
Join Date: Nov 2007
Location: Adelaide, South Australia
Posts: 4,049
The process should be identical.

Nothing happens when the user clicks on the close button.
Can you confirm the code is actually running?
Owner and Manager of
CypherBYTE, Microsoft Access Development Specialists.
Microsoft Access MCP.
And all around nice guy!

"Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
"...teach a man to code and he'll be frustrated for life! " -- georgev
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On