Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 26th, 2006, 10:22 AM
Authorized User
 
Join Date: May 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Required Fields

Question regarding required fields, is there a way to stop the following message from appearing “The field ‘Lastname’ cannot contain a Null value because the Required property for this field is set to True. Enter a value in this field.”, when the change made ends up with no results? For example in a sub form a user proceeds to enter in a last name “Smith” then back spaces out the result to a blank field, now the user wants to change to another tab (i.e. another sub form) and that’s when the message screen comes up. Is there a way to stop the error message from coming up if no actual change has been made without hitting the ESC key? Any suggestions?
 
Old May 26th, 2006, 12:33 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Yes, but it requires more coding.

You need to allow nulls (Required = No) in the last name field, but then do data validation on all your forms.

The problem with this is that you will also need to remove the close buttons etc from your forms to prevent the user from closing the form or moving to the next record without using your data validation triggering events.

If you remove the record selector and form close buttons, you can add code that checks for the last name data and prompts the user to enter a value and exits the close of next record or save record event. This is dicey when you are referencing subform values as well.

So the answer is yes and no. Who do you want to inconvenience, and how much?

I don't think there is a way to get rid of the error message you speak of without changing the required property since it is handled at a lower level in the object model.

mmcdonal
 
Old May 26th, 2006, 01:27 PM
Authorized User
 
Join Date: May 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I guess the simplest approach to this would be to set the Required property to no and use the * symbol in the label to specify the fields you want the user to enter and leave it to them i.e. Last name: Smith * (place outside the entry field). (* = required) Thank you for the suggestion.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help required zaeem SQL Server 2000 2 May 28th, 2008 12:48 AM
Resolved! - Verify Required fields and email form dartcoach HTML Code Clinic 25 April 28th, 2008 12:48 PM
Some help required ! codenet C# 2005 1 September 24th, 2007 04:01 PM
Guidance required whyvenky General .NET 0 February 26th, 2006 03:03 AM
Using Forum fields select fields on the fly hellosureshkumar Crystal Reports 0 December 17th, 2004 08:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.