Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inadaquecies w/ Input Masks 1

Status
Not open for further replies.

Hookstrat

Technical User
Jun 11, 2002
43
US
Hi!
I have an input mask for a field called manhole ID that looks like this: 0000"00". All of the ID's end with "00". The ID's work lik this 100100,100200,100300, 100400,100500,etc. However, when I get to the one hundreth manhole I need to identify, the tag should look like this 110000. Access is abbreviating this to look like 1100. How do I stop access from ruinging my tables by autocorrecting these values why still maintaining input masks?? I greatly appreciate any advice pertaining to this subject.
Sincerely,
Luke Hoekstra
 
If you don't particularly care if the quotes are visible at the point of input, you can always format the field when you print or subsequently view the field...

LEFT([MANHOLE],4)&"00"

As long as the field's property is set to TEXT in the database, this will always work.

I can't get the input mask to accept the double quote you need, so I'm not sure you can do this any other way.

Hope this helps.

Jim "Get it right the first time, that's the main thing..." [wavey]
 
Thanks for taking the time to answer my question "jdegeorge". You offered an interesting solution to my problem, but I would like the data type of my ID's to remain as numbers instead of text. That was the whole reason I went through the trouble of designing an identification system. The first number of the idea tells what branch the manhole is located in...so manhole 100100 is the first manhole on the first branch. The doubles zeros indicate the structure is a manhole, because all manhole end with "00". Then the line of pipe connected to manhole 100100 is called 100101. Out of each line of pipe there are services (the actual line of sewer that goes to your toilet), these are numbered 02-99 (there's never more than 98 services on a particular line of pipe). So the ID 100102 is the first service, from the first line, connected to the first hole on the first branch. Did you get all that?? My use of input masks is only so that users will be able to update the system with as little room for error as possible. That's why I wanted to make sure all of the manholes ended with "00". Unfortunately, access 2000 will not allow that to happen so easily. Anyone with additional help on this topic will personally recieve a big fat Bozo button from: Yours Truly,
Luke Hoekstra
 
When assigning properties to fields for numbers, I use the rule of thumb...if I'm not doing any math with them, set the field to text.

If you can't figure out a way to enter "00" as part of a mask, and you know that a certain number of elements are always required without the "00" part, set the field to text and have an input mask. For 6 required digits, for example, before the "00", set the input mask to

000000

Zeros require the user to input all characers. Then you can append the "00" for future use of the field in reports or forms.

Jim "Get it right the first time, that's the main thing..." [wavey]
 
One other suggestion.....

Assumptions: you always want the manhole to end in two zeros (00) and it is always six digits long....You also want the manhole to be a number....you are using a form for input...

Remove the input mask from the tbale (if you have one)
Set the input mask on the form for the manhole field to 0000 (that's right, only four zeros)
Using the AfterUpdate Property of the field, put the following:
Me![name of field] = Me![name of field]*100

This will allow you to put in the first four digits and then multiplies it by 100 (to add the next two zeros) immediately after you enter the first four....I amde this work in my test database, so you should be set...

Good Luck and Let me know. It's not important that someone else can do in one step what it took you ten to do...the important thing is that you found a solution. [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
Almost forgot....

I also use the rule of not using number unless you need to do math to the numbers......it is a VERY good rule to follow.....but in this case, if you really want to keep it numbers, the above solution will work. It's not important that someone else can do in one step what it took you ten to do...the important thing is that you found a solution. [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
Thanks again for all of the help! I decided to take all of your advice and use "text" as my datatype. I used show all and deleted all of my relationships and saved the relationships. Then I was able to change the datatype for the fields without relationships, but not for the important one that had a relationship!! How can I clear my relationships so it will let me change it from number to text?! Don't tell me I have to start completely over!!!! It seems so close, yet so far away! Thanks again all!

Sincerely,
Luke Hoekstra
 
Well, as usual, I took the easy way out. I created a new database and then imported all of my tables. I was able to change my datatype and just recreate all of my relationships (I only have 4 or 5). Thanks again for everyone's help, now if I could just do something about these pesky wabbits.......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top