Input mask not working correctly...

Stoss

Registered User.
Local time
Today, 15:45
Joined
Nov 5, 2010
Messages
107
Hello all,

I am having an issue with an input mask not working correctly. I have a text box that has an input mask 0000\-00;0;_ which displays as, for example, ____-__ so a user can put in a number like 1234-56. If I type in a number manually, it works fine. Puts it into the table as 1234-56 but if I populate that field through VBA it doesn't. I populate that field with just straight numbers like 123456 and then it display in the text box 1234-56 but goes into the table as 123456. I tried putting an input mask in the table field itself and it shows it as 1234-56 but does not exactly do what I need it to do. I have code other places (not written by me :) ) that is looking for that "-". So, it seems like it is not recognizing the "-" and then doesn't work.

I am using Access 2003

Can someone please direct me in the right direction with this one.
Thanks,
Stoss
 
That's weird, I just created a table with a field that hast he following input mask "0000\-00", what's the added semicolon and zero that you have there?

Created a form based on that table with the same input mask for that field, then added a button who's on click event sets that field to "123456" and it shows as 1234-56 in the field and in the table.
 

Attachments

Try the "MID" function as an alternative approach.

Code:
MyField=Mid(MyString,1,4) & "-" & Mid(MyString,5,6)
 
Thanks for trying that G37Sam!

I am not sure what is going on but it doesn't seem to be working correctly. I tried Steve R.'s approach and that works so and this time, I am not going to worry about it. I don't have time to figure out why it isn't working so I am just going to sweep it under the rug and go with what is!

Thanks guys for your help!
-Stoss
 
Why don't you try to upgrade to version 2007 mate :cool:

Not everyone has a choice.

I have 97, 2003 & 2007 installed on my 3 workstations to cater for all the teams I develop databases for. I am not limited by my software but by the end user's software.

And I suspect I'm not alone.
 

Users who are viewing this thread

Back
Top Bottom