A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Display message when add field fails



 
 
Thread Tools Display Modes
  #1  
Old October 5th, 2009, 04:51 PM posted to microsoft.public.access.forms
Paul Washburn[_2_]
external usenet poster
 
Posts: 31
Default Display message when add field fails

Ive have a button on my form that adds a new field using the default add
field button field options add field. I modified the table so that the
title field on the form will not accept blank values. Now when i hit the
button if the title is blank the form does nothing. Could someone help me
with the marco language to display a prompt informing the user that the add
failed because the title field is blank?

Thank you in advance.
  #2  
Old October 5th, 2009, 06:58 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Display message when add field fails

Paul

Just to make sure we're using the same terms the same way ...

It sounds like you are describing adding the ability into a user form to
allow them to add a new field to a table definition.

If this is what you are doing, how are you ensuring that the user knows
enough to add the new field to the proper table, and to maintain referential
integrity.

If Access were just a spreadsheet, adding a field would be largely
irrelevant. But Access is a relational database...

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

"Paul Washburn" wrote in message
...
Ive have a button on my form that adds a new field using the default add
field button field options add field. I modified the table so that
the
title field on the form will not accept blank values. Now when i hit the
button if the title is blank the form does nothing. Could someone help me
with the marco language to display a prompt informing the user that the
add
failed because the title field is blank?

Thank you in advance.



  #3  
Old October 5th, 2009, 07:07 PM posted to microsoft.public.access.forms
Paul Washburn[_2_]
external usenet poster
 
Posts: 31
Default Display message when add field fails

Think were on different pages. The form allows the user to add a record to
an existing table and save that entry. Setting the field property to not
allow null prevents the record from being added to the table with missing
data. The issue that im having is that it does so silently without informing
the user that it has failed and why it failed. Pressing the button produces
no visible results when the required field is blank.

Thanks for the help.

"Jeff Boyce" wrote:

Paul

Just to make sure we're using the same terms the same way ...

It sounds like you are describing adding the ability into a user form to
allow them to add a new field to a table definition.

If this is what you are doing, how are you ensuring that the user knows
enough to add the new field to the proper table, and to maintain referential
integrity.

If Access were just a spreadsheet, adding a field would be largely
irrelevant. But Access is a relational database...

More info, please...

Regards

Jeff Boyce
Microsoft Access MVP

"Paul Washburn" wrote in message
...
Ive have a button on my form that adds a new field using the default add
field button field options add field. I modified the table so that
the
title field on the form will not accept blank values. Now when i hit the
button if the title is blank the form does nothing. Could someone help me
with the marco language to display a prompt informing the user that the
add
failed because the title field is blank?

Thank you in advance.




  #4  
Old October 5th, 2009, 07:30 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Display message when add field fails

Ah, adding a record, vs adding a (new) field, got it!

Allen Browne's web site has good information about silent fails on new
records.

The gist of it is that you may want to explicitly force a save, rather than
let Access silently fail.

If you don't want the user to be able to try to add (incorrectly), consider
using the form's BeforeUpdate event to run your validation checks. If a
required field has a Null, you can cancel the save and prompt the user.

?Any chance you can infer a default value for that field?

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP


 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.