473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Editing lablels for input masks

53
a few days a go i was kindly helped with the trouble i was having on editing lables wjhere i wanted to change access' messages to my own.
Below si the qeustion i set a few days agoa , which worked brillintantly with the answer posted below


how do you enable when making a order in the sub form called “all customer order details sub form” alter the error message when you put the same product in the same order.

currently in the all customer order details sub form”, i am mot allowed to enter products in twice for one order which is great. however the error message is automatic, and i want to edit this.
Have you got any tips, it will be much apreciated
thank you
If I follow your logic correctly, you wish to replace the Standard Acces Error message with a custom one of you choice and not display the generic one from Access. To accomplish this, you must place code in the Form's Error() Event and place the proper value in the Response parameter.


Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Error(DataErr As Integer, Response As Integer)
  2. Const conDuplicateKey = 3022
  3. Dim strMsg As String
  4.  
  5. If DataErr = conDuplicateKey Then
  6. Response = acDataErrContinue
  7. strMsg = "Each employee record must have a unique " _
  8. & "employee ID number. Please recheck your data."
  9. MsgBox strMsg
  10. End If
  11. End Sub 
  12.  
i now want to know how do you do alter the message, if i have placed an input mask e.g L?09\ 0LL for a post code in the main table design Customer. i would like to edit this, as the message is not userfreinfly and shopws the input maks.i would like to know how and where i place the new user freindly message. is it in the form?
is it always the same template for all input masks, as i have quite a few.
thankyou so much, you were great help last time!
THANK YOU!
Panjap
Feb 14 '07 #1
12 3148
NeoPa
32,556 Expert Mod 16PB
Are you talking about an error message associated with the Input Mask or with field validation?
If the latter, then you need to put it in the Validation Text property.
Feb 15 '07 #2
panjap
53
Are you talking about an error message associated with the Input Mask or with field validation?
If the latter, then you need to put it in the Validation Text property.
hello, thank you for your reply,
i am taliking about the error message associates with the input mask.
e.g. for the field Poscode, i have inserted an input mask - L?09\ 0LL
If i do not follow this out correctly, and place in a worng postcode, i get, an error message saying, 'The value you have entered isn't appropiate for the input mask 'L?09\ 0LL' ,specified for this field.
How do i alter this to make is more user freindly for my forms, i have tried validation text and this does not work.
Thank you once again!
Feb 16 '07 #3
NeoPa
32,556 Expert Mod 16PB
Sorry Panjap - I just don't know I'm afraid.
I'll see if I can get someone else to look at this for you.
Feb 16 '07 #4
panjap
53
Sorry Panjap - I just don't know I'm afraid.
I'll see if I can get someone else to look at this for you.
thankyou NeoPa, thanks for trying.
cheers
Feb 16 '07 #5
NeoPa
32,556 Expert Mod 16PB
Don't give up just yet.
I've invoked a 'Swarm' of Access Experts - let's see if someone can come up with something.
Feb 16 '07 #6
ADezii
8,834 Expert 8TB
a few days a go i was kindly helped with the trouble i was having on editing lables wjhere i wanted to change access' messages to my own.
Below si the qeustion i set a few days agoa , which worked brillintantly with the answer posted below



If I follow your logic correctly, you wish to replace the Standard Acces Error message with a custom one of you choice and not display the generic one from Access. To accomplish this, you must place code in the Form's Error() Event and place the proper value in the Response parameter.


Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Error(DataErr As Integer, Response As Integer)
  2. Const conDuplicateKey = 3022
  3. Dim strMsg As String
  4.  
  5. If DataErr = conDuplicateKey Then
  6. Response = acDataErrContinue
  7. strMsg = "Each employee record must have a unique " _
  8. & "employee ID number. Please recheck your data."
  9. MsgBox strMsg
  10. End If
  11. End Sub 
  12.  
i now want to know how do you do alter the message, if i have placed an input mask e.g L?09\ 0LL for a post code in the main table design Customer. i would like to edit this, as the message is not userfreinfly and shopws the input maks.i would like to know how and where i place the new user freindly message. is it in the form?
is it always the same template for all input masks, as i have quite a few.
thankyou so much, you were great help last time!
THANK YOU!
Panjap
Sorry Panjap:
To the best of my knowledge, there is no way to modify the Default Access Error Message for invalid Input Masks. I'm afraid this is controlled internally by Access. Don't give up hope - I could be wrong. I did, however, post this Pseudo Input Mask Validation Code just in case you are interested. It's just a guideline and I'm sure it can be imroved and/or streamlined. It checks for an Input Mask of L0\0:
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtTest_BeforeUpdate(Cancel As Integer)
  2. If Len(Me![txtTest]) <> 3 Then  'must be 3 Characters
  3.   MsgBox "Entry must be exactly 3 Characters long", vbExclamation, "Invalid Entry"
  4.     Cancel = True
  5. 'Check for A - Z in the 1st character
  6. ElseIf Asc(Left(Me![txtTest], 1)) < 65 Or Asc(Left(Me![txtTest], 1)) > 90 Then
  7.   MsgBox "Only letters A thru Z required in the 1st Character", vbExclamation, "Invalid Entry"
  8.     Cancel = True
  9. 'Check for any digit 0 - 9 in the 2nd position
  10. ElseIf Asc(Mid(Me![txtTest], 2, 1)) < 48 Or Asc(Mid(Me![txtTest], 2, 1)) > 57 Then
  11.   MsgBox "Any Digit 0 -9 is required in the 2nd Character", vbExclamation, "Invalid Entry"
  12.     Cancel = True
  13. 'Check for the Literal "(" in position 3
  14. ElseIf Mid(Me![txtTest], 3, 1) <> "(" Then
  15.   MsgBox "( must appear in the 3rd Character", vbExclamation, "Invalid Entry"
  16.     Cancel = True
  17. End If
  18. End Sub
Feb 16 '07 #7
willakawill
1,646 1GB
Here is the answer for access 2000. You can check it for us and let us know if it still works.
Feb 16 '07 #8
NeoPa
32,556 Expert Mod 16PB
Nice one Will.
Panjap, can you do the business and let us know how you get on. We're all interested in this one now :)
Feb 16 '07 #9
ADezii
8,834 Expert 8TB
Here is the answer for access 2000. You can check it for us and let us know if it still works.
Nice job willy!
Feb 16 '07 #10
panjap
53
THAT WAS BRILLIANT!!!!!!!!!!!!!!!!!!
Thankyou so much, you made my day, i really appreciate the time you all spent finding this, i know how hard it was to do. Cheers you all for all the help
i really appreciate all that you all did!
Panjap
Feb 16 '07 #11
panjap
53
Thankyou for all your help. i just have one last question

how do you when making a order in the form called “all customer order details sub form” insert an error message into sub form called
"amount owed customer 3", where i have calculated the balance left on a credit limit. How do i insert the error message once the field "Balance Left On Credit", goes into minus. this field was calculated in the query "amount owed customer 3",

this also applies to the form "stock level 2 search", in the field "Qty_in_Stock", which again was a calcualted field.

I do not know if this helps, where i had a similar problem and was helped by
ADezii who's relpy is below with the question

how do you enable when making a order in the sub form called “all customer order details sub form” alter the error message when you put the same product in the same order.

currently in the all customer order details sub form”, i am mot allowed to enter products in twice for one order which is great. however the error message is automatic, and i want to edit this.
ANSWER
If I follow your logic correctly, you wish to replace the Standard Acces Error message with a custom one of you choice and not display the generic one from Access. To accomplish this, you must place code in the Form's Error() Event and place the proper value in the Response parameter.


Code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Error(DataErr As Integer, Response As Integer)
  2. Const conDuplicateKey = 3022
  3. Dim strMsg As String
  4.  
  5.   If DataErr = conDuplicateKey Then
  6.     Response = acDataErrContinue
  7.     strMsg = "Each employee record must have a unique " _
  8.              & "employee ID number. Please recheck your data."
  9.     MsgBox strMsg
  10.   End If
  11. End Sub
Have you got any tips, it will be much apreciated
thank you
Feb 16 '07 #12
Rabbit
12,516 Expert Mod 8TB
This question and the question that ADezii answered is different in nature. In the question that ADezii answered, you were trying to bypass an existing error message within Access. What you are trying to do now is to create an error message that does not already exist.

I don't know your database so I can only give you general guidelines and hope you can run with that until someone who knows the specifics of your database can provide you with solid code.

In an event of your choosing, you'll have to check for the negative balance, if it's negative, then MsgBox "Error".
Feb 16 '07 #13

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

Similar topics

4
by: Dan Weeb | last post by:
Hi All, I have struggled through this far with help from many of you so thanks. I am stuck again. I am really new to this so don't be harsh :-) There are a few problems. You can run the script...
6
by: dude | last post by:
hello how would i make an input mask that only makes the first letter a capitol one? i've been playing around and testing various masks, also tried the wizard, but i've had no luck. could...
2
by: Mark Lees | last post by:
I want to create an input mask for a phone number and I would like the area code to always be (801). However, I want the users to be able to edit it if necessary. Would it look like this =...
7
by: F. Michael Miller | last post by:
I have a db with Access front end, sql back, linked tables. I need to be able to change input masks at the table level in code. Any ideas? Thanks!
6
by: Regnab | last post by:
Morning All, I'm trying to ensure that when the user enters a number on a form, the database automatically leaves a space after the 3rd number. I've tried to do this using input masks, but when...
4
by: Tina | last post by:
Are there any textbox controls capable of enforcing client side editing i.e. telephone number edit masks, enforce numeric, etc. Thanks, T
16
by: Filips Benoit | last post by:
Dear all, I have a datefield that sometimes should store hours and minutes too ans use following format and inputmask. dd/mm/yyyy hh\:nn 09/09/0000\ 99:99;0;* Typing date, hour and...
4
by: Dave | last post by:
Hello - Say I have a 32 bit value in data (v:4, r:4, l:8, p:16) unsigned char data; Now, for portabilities sake, I want to use shifts and masks to access these fields, instead of accessing...
5
by: ezechiel | last post by:
hi everyone.. i read on another forum that it is possible to define multiple input masks for a textbox (for example). There is a textbox field where you can enter the name of a machine. The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.