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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|