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
|
|||
|
|||
Standard Error Message
I have two forms that have several required fields. I have set validation
rules for the required fields on both forms. For one form, the validation rules are working as I expect them to (display a pop-up box to the user telling them what field must be filled out and returning the user to the form before saving). For the other form, the validation rules are not working as I expect them to. The pop-up box does not appear and instead, the standard error message that Access displays is appearing (and upon closing that, the Access message appears stating that the record can't be saved). Any ideas on how I can make the 2nd form work the same way that my 1st form is working?? Thank you in advance! |
#2
|
|||
|
|||
In looking at this further, I have found that the problem I am encountering
only happens when I'm trying to save a new record. My validation rules seem to work fine if the record is existing and is just being edited (if someone deletes the value in an existing record on the form.) Anyone know how I can get rid of the standard message and display my own on required fields in new records on my forms? Thanks again! "monkey" wrote: I have two forms that have several required fields. I have set validation rules for the required fields on both forms. For one form, the validation rules are working as I expect them to (display a pop-up box to the user telling them what field must be filled out and returning the user to the form before saving). For the other form, the validation rules are not working as I expect them to. The pop-up box does not appear and instead, the standard error message that Access displays is appearing (and upon closing that, the Access message appears stating that the record can't be saved). Any ideas on how I can make the 2nd form work the same way that my 1st form is working?? Thank you in advance! |
#3
|
|||
|
|||
The standard error messages only appear when your error handling and
validation code do not work. If you have your validation code in the table, I suggest you remove it from there, and include it on your form. The most common place is in the Before Update event of the control. If you have any cross field validation, that is ususally in the Before Update event of the form. "monkey" wrote: In looking at this further, I have found that the problem I am encountering only happens when I'm trying to save a new record. My validation rules seem to work fine if the record is existing and is just being edited (if someone deletes the value in an existing record on the form.) Anyone know how I can get rid of the standard message and display my own on required fields in new records on my forms? Thanks again! "monkey" wrote: I have two forms that have several required fields. I have set validation rules for the required fields on both forms. For one form, the validation rules are working as I expect them to (display a pop-up box to the user telling them what field must be filled out and returning the user to the form before saving). For the other form, the validation rules are not working as I expect them to. The pop-up box does not appear and instead, the standard error message that Access displays is appearing (and upon closing that, the Access message appears stating that the record can't be saved). Any ideas on how I can make the 2nd form work the same way that my 1st form is working?? Thank you in advance! |
#4
|
|||
|
|||
I am totally new at this and didn't realize that I am able to do that. I
have found the BeforeUpdate event but am unsure of what the code should look like. Any suggestions? Thanks in advance!!! "Klatuu" wrote: The standard error messages only appear when your error handling and validation code do not work. If you have your validation code in the table, I suggest you remove it from there, and include it on your form. The most common place is in the Before Update event of the control. If you have any cross field validation, that is ususally in the Before Update event of the form. "monkey" wrote: In looking at this further, I have found that the problem I am encountering only happens when I'm trying to save a new record. My validation rules seem to work fine if the record is existing and is just being edited (if someone deletes the value in an existing record on the form.) Anyone know how I can get rid of the standard message and display my own on required fields in new records on my forms? Thanks again! "monkey" wrote: I have two forms that have several required fields. I have set validation rules for the required fields on both forms. For one form, the validation rules are working as I expect them to (display a pop-up box to the user telling them what field must be filled out and returning the user to the form before saving). For the other form, the validation rules are not working as I expect them to. The pop-up box does not appear and instead, the standard error message that Access displays is appearing (and upon closing that, the Access message appears stating that the record can't be saved). Any ideas on how I can make the 2nd form work the same way that my 1st form is working?? Thank you in advance! |
#5
|
|||
|
|||
I don't know what your rule is, but the Before Update event is the right
place to put it. There are two types of Before Update events. One for each control on the form and one for the form itself. You use the control Before Update to do whatever you want to check the validity of the data entered or take any action based on what was entered in the control. The form's Before Udate is useful to take action before the data in the form is written to the tables. A basic example would be if you have a text box that has to have data in it and the length of the data entered must be between 3 and five characters long. We will call this control txtSomeStuff. If IsNull(Me.txtSomeStuff) Then MsgBox "Data is Required for this Field" Cancel = True ElseIf Len(Me.txtSomeStuff) 3 or Len(Me.txtSomeStuff) 5 Then MsgBox "Entry must be between 3 and 5 characters long" Cancel = True End If Notice the Cancel = True. This cancels the update for the control and leaves the focus on the control so you can correct it. "monkey" wrote: I am totally new at this and didn't realize that I am able to do that. I have found the BeforeUpdate event but am unsure of what the code should look like. Any suggestions? Thanks in advance!!! "Klatuu" wrote: The standard error messages only appear when your error handling and validation code do not work. If you have your validation code in the table, I suggest you remove it from there, and include it on your form. The most common place is in the Before Update event of the control. If you have any cross field validation, that is ususally in the Before Update event of the form. "monkey" wrote: In looking at this further, I have found that the problem I am encountering only happens when I'm trying to save a new record. My validation rules seem to work fine if the record is existing and is just being edited (if someone deletes the value in an existing record on the form.) Anyone know how I can get rid of the standard message and display my own on required fields in new records on my forms? Thanks again! "monkey" wrote: I have two forms that have several required fields. I have set validation rules for the required fields on both forms. For one form, the validation rules are working as I expect them to (display a pop-up box to the user telling them what field must be filled out and returning the user to the form before saving). For the other form, the validation rules are not working as I expect them to. The pop-up box does not appear and instead, the standard error message that Access displays is appearing (and upon closing that, the Access message appears stating that the record can't be saved). Any ideas on how I can make the 2nd form work the same way that my 1st form is working?? Thank you in advance! |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
context sensitivity for outlook standard toolbar | jeffo | General Discussion | 1 | June 18th, 2005 02:19 PM |
Changing standard charts | Mary Ann | Powerpoint | 4 | June 17th, 2005 06:19 PM |
downside standard deviation | Stephen | General Discussion | 5 | July 11th, 2004 10:34 PM |
Gain / Loss Standard Deviation | JW | Worksheet Functions | 1 | May 19th, 2004 05:20 PM |
Standard Deviation Plot | Sarah | Charts and Charting | 2 | October 6th, 2003 05:04 PM |