Forms :: Customizing Input Mask Violation Error Message?
Jan 5, 2014
I am trying to change the standard input mask violation error message to a personalised one. I have found this code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Const INPUTMASK_VIOLATION = 2279
If DataErr = INPUTMASK_VIOLATION Then
MsgBox "There was an input mask violation in the field no!!"
Response = acDataErrContinue
End If
End Sub
However, i would like to change the message for a number of different text boxes. and i don't know how to isolate each one, and give each one a different message?
I want to have an input mask on an 'Expiry Data' Field so that the input method is 'MON-YY" and I need access to realise it as a data. And then I also need when a user opens a record an anything that is 2 weeks from expiring I need an error message to pop up.
I've put an input mask into a table and would like to personalise the error message to give the user more information about how they should be entering the data correctly. I don't know where to start with this - can someone point me in the right direction??
I Have a field called appointment date and i have set the input mask as short date 00:00;0;_
the data type for the field is date/time but for some annoying reason this error message appear when I enter a date to the table... which for example is written like this 01/03/2003
I'm trying to apply a custom input mask to a text box control. The text box must contain a 43 character string, broken into sections as follows :
AAAA-AAAAA-AAAAA-AAAAAA-AAAAAAAAA-AAAAAAAAAAA-AAA
(The format is quite strict and always comprises alphanumeric characters , hence I figured an input mask would, if nothing else, support the user to key the string accurately from its constituent parts...)
However, when I try to apply the input mask to the text box, I seem to run out of characters - I get as far as the below but the input mask wizard won't let me extend the mask to the final 8 characters
AAAA-AAAAA-AAAAA-AAAAAA-AAAAAAAAA-AAAAAAAAAAA-AAA
Are input masks restricted to 35 characters in length? And if so, how else could I make this, admittedly complex, text input more manageable for end users?
I have a form (Access 2007) that requires user to enter a date.
Using the standard date field (short date format) with the date picker works fine however some users prefer to enter the date via the keyboard (some prefer the date picker).
If I set an input mask (to facilitate keyboard entry) for the text box then the date picker disappears.
Is there any way to apply the date picker and the input mask to the control to accommodate all users?
I have to add an Input Mask or force the user to enter in a specified format in a text field. The condition is, text should start with "A" or "T". The complete format is A-12345-67890 or T-12345-67890.
I just need a quick, simple expression that I can copy and paste into the input mask for a control that I have on a couple of forms that prevents someone (me) to continue tabbing to the next control if the value entered is a duplicate.
Hello I am new to this forum. I am trying to use the append query on two tables that are identical in data type, from TblA to TblB, but cannot append due to key violations for each row.
Both TblA and TablB have an autonumber primary key, although TblA does not need to have a primary key. Any suggestions as to what I should be looking for first?
Wow, this thing is annoying me. I give up! I've attached the database for anyone here to have a look at. I promise there's no nasty code on it, although you should be able to see my code and hopefully pick the problem if you disable macros anyway.
I use VBA to prompt users to enter their staff number, the member's number and the book ID. The same VBA checks to make sure that it's a valid number that they're entering, that's it's actually present in the table it's being referenced from. (Command0 button. Command1 is to return an item)
It then takes these values, the current date and another date variable and inserts into the LOAN table. The loan table has enforced referential relationships with the book, member and staff tables.
All the fields in Loan (except for the autonumber PK) are not required, and have no validation formulas, zero-length is permitted where applicable.
I KNOW that the numbers being inserted are in the related tables! They're the same data type - long integers, and the related tables' primary keys are not autonumbers.
So why am I still getting a key constraint violation??
Can someone please help me??
Correction: I'm trying to attach the database, but it's too big, even zipped. Why isn't RAR accepted? Anyway, the file is hosted here: http://jellopy.com/files/newdb.zip
Hi, I have a form that consists several buttons. One is to delete a table A, then add records to several tables and eventually it will do a join and insert records to table A, and display a report. It always works while all tables reside in the same Access database. Now we are trying to migrate to SQL server but not ready to get rid of Access yet. So we exported all tables to SQL server and created linked tables. We can open tables directly from Access without any problem. It shows the contents as the SQL database But when we tried to open the form and run the same button as before, we got an error:
Microsoft Access can't delete 0 record(s) in the delete query due to key violations and n record(s) due to lock violations.
We have no idea why this happens. Most of the time, it worked the first time when we clicked on the button. But we got the message when we clicked on the same button the second time. If we clicked "Yes" then it will append new records. There will be duplicate records since it doesn't delete the existing ones.
Did any of you encounter a similar problem before? Thanks in advance!
I want to use input mask in my email field i.e the @ must be present but i must be allowed to input values or numbers before and after the @. This did not worked because i have fixed the values: ????@???? thanks
let's say i have a field, in which i store and identity card number. This number may consist up to 7 digits (of which 3 are mandatory) plus 1 letter (mandatory) at the end. Thus a valid identity card number may be the following: 1234567M, 123M
Eventually, since the field must always contain a letter, i set the data type to Text with field size of 8 ... and i set the inout mask as follows:
9999000L (since the first 4 digits are mandatory). With this input mask, if i have an ID Number of 123M, i have to input it as 0000123M.
Although, I would like to have the leading zeros, is it possible that during data entry time, i would simply type 123M, and i will get the zeros automatically, after the field loses the focus, rather than having to type them myself ?
I am trying to create an input mask for a name field. I have Spanish names with two last names separated by a hyphen, a comma after the two last names, a space, and then the First Name a space and the Middle Name. The First Last Name needs to be in all capitals like the example. Example: NARANJO-Ramirez, Jose Luis
Can someone please help me format this mask. One trick is that there aren't always middle names. Since all parts of the name are different lenghts for everybody, I need to have an optional number of characters for each of the four parts of the name.
I have a text box on a form that holds a grid reference, (2 letters and 6 numbers). I have set the box up with an input mask, (>LL000000;0;_). Is there a way that when the user clicks in the box that the cursor will go to the start of the box. At present it goes wherever they click in the box. If they dont notice then the machine starts beeping at them, most annoying!
I have created an input mask but it depends what type of currency is..
If Me![Currency Counter] = "1" Then Me![Serial No].InputMask = "LL00 000000" Else If Me![Currency Counter] = "2" Then Me![Serial No].InputMask = "LL-00000000-L" endif endif
The problem is that if for example the currency counter = 2 the serial must be AA-11111111-A but it is saving AA1111111A and i dont want it to save it like this.
I have a text box that has an Input Mask setup. The box is format to be ##-### (00-000;0;). My problem is, when the user clicks in the box it does not start at the beginning, it starts where ever the user clicks inside the box. Is there way to for when you click inside the box it automatically starts at the beginning?
I have a text box that has an Input Mask setup. The box is format to be ##-### (00-000;0. My problem is, when the user clicks in the box it does not start at the beginning, it starts where ever the user clicks inside the box. Is there way to for when you click inside the box it automatically starts at the beginning?
I am building an access database for my college project and I essentially have a quotation form that when I click a button 'Convert to Invoice' it creates a new record in the invoice table and then creates new records in the invoice details table which match the quotation details table. This is working as it should but for only the first 2 customers in my customer table?
On the quote form I have a combo box which is linked to the customer table and updates the quote table based on the selection. If I select customer 1 or 2 and click 'convert to invoice' it works and opens an invoice form based on the inserted data however if I select any other customer it returns an error that the record wasn't added to the table due to key violations?
As far as I can tell I am not trying to update the primary keys in the Invoice Table or the Invoice Details Tables.