473,545 Members | 721 Online
Bytes | Software Development & Data Engineering Community
+ 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 5497
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
5793
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 to have images. Is this method recommended? Should I be doing it another way?
5
26999
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 changing the text color. I can set style.background='red' to change the background color to red. But if I say style.color='green' to change the...
3
3000
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 message when the field is blank and Access will not let me save the record. However, I also have a Close command button with the code: DoCmd.Close...
2
2433
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 here? thanks! Code in Form1 that has Text box named Textbox // this linedoes do anything it jsut shows theres one textbox1 insdie form on ...
3
1371
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 AllowDBNull property but it's not the same... Regards Kejpa
4
1843
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 required property or there is some way to do that? What I see now is a poor documentation on the Internet about that. Thanks, Just D.
1
2273
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 mouseover) text colour etc Thanks
2
4999
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
11400
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 to 250 but I get a read only error when I try to change it. Is there anyway to change the size in code? thanks big time for any help
8
2594
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
7656
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7805
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7416
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7752
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5969
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5325
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4944
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.