473,473 Members | 1,511 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can I change the text for the required property warning?

9 New Member
Hello. I have a database in Access 2002.

I have a table where the field "Name" is set as a required field.

I have a form that populates that table. When somebody forgets to fill in the Name and they attempt to proceed forward, they receive this message:

"The field 'Name' cannot contain a Null value because the required property for this field is set to True. Enter a value in this field."

Can I change the text of this message? I would like to change it to be a little more user friendly.

I know I can use the code below to write my own message. However, I have found people are still able to move ahead without filling in name by clicking on the little forward arrow at the bottom of the form or by using the mouse wheel. I'm not sure why they do this...but they sometimes do. By making the field required in the table itself, people cannot proceed without filling in Name no matter what. So, my ideal would be to change the default message itself. Thanks for your time and ideas.

I have tried this, but people can still bypass it:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Save_Record_Button_Click()
  2. On Error GoTo Err_Save_Record_Button_Click
  3.  
  4. If IsNull(Me![Name]) Then
  5.   MsgBox "You need to input a Name in order to proceed", vbCritical, _
  6.          "Missing Required Data"
  7.            Exit Sub
Apr 20 '11 #1
1 5486
Andy Sauer
9 New Member
Great article at:

http://bytes.com/topic/visual-basic/...essages-access

The only thing is I had to make a slight change in the code. The code I used was:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Error(DataErr As Integer, Response As Integer)
  2. If DataErr = 3314 Then
  3.     MsgBox "You are missing a Name."
  4.     Response = acDataErrContinue
  5. Else
  6.     MsgBox "Error No.:" & DataErr
  7. End If
  8. End Sub
Error 3314 was the original message, and I am replacing it with my own message. I found out 3314 was the error number by clicking on the Help button when the error appeared. In the Help window, it states the error number.

As the article states, you can use this code to change any error. Thanks to hyperpau for the great information.
Apr 20 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: OM | last post by:
I've found out that I can use <div id = "variable"><div> to change text and pictures on mouseovers. All I have to do is change "variable" to be the HTML text I want. I can even change the text...
5
by: AFN | last post by:
I'm trying to set a submit button to change text and color when clicked. Like saying "please wait" instead of "submit" and then changing the background color and text color. All works, except for...
3
by: Mark | last post by:
Access97 --- I set the Required property for a field at the table level and I have a form that contains that field. When I click the Close button at the top left of the screen, I get an error...
2
by: shal | last post by:
hello I am trying to change text color of the textbox1 from another form named Form2. i am using following code right now but it doesnt change property of textbox1. can you tell me whats wrong...
3
by: Kejpa | last post by:
Hi, I have a datatable which I try to update but the update fails because a required property of one of the fields is set to True. Where can I find this property? On the Column there's only a...
4
by: Just D. | last post by:
How can we change the property of one subdirectory of the Virtual Directory? One of the directories should be granted "Write". Should we delete this Virtual Directory to recreate it with the...
1
by: Robert T | last post by:
Hi I would like to change the title property(the hint displayed when you move over it) of an elements colour/and or text size. Is this possible Can I change the title property's (hint on...
2
by: Billy | last post by:
Hopefully a simple one, what is the syntax to force a property to be required in a user control? I thought it would below, but it's not: Public Required Property propName() As String
4
by: sparks | last post by:
Well I have an old database that all the text fields are set to 25-50 don't know why but I needed to change them all to 250. Well I wrote some code to change the size of the fields in the tables...
8
by: Randoz | last post by:
I am trying to write an if/then statement to disable the "Required Property" and then to enable it after a record is saved. Almost like the visible and locked code.
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.