473,413 Members | 1,799 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,413 software developers and data experts.

Changing or editing the input mask but not mess up old data?

1
I have a database in access where a field used to allow only 4 digit numbers separated by a slash. (ex: 4444/4444). However, we have now started to have numbers that can be 5 digits and 5 digits. (ex:55555/55555).

The input mask was previously 0000/0000. If I change it to 90000/90000, it changes my old data by moving the numbers forward in front of the slash (eg: 1234/5678 now looks like 12345/678). I have tried different combinations of where to place the 9 for the optional digit and how to enter data (from left to right using !) but it always changes my old data by moving the numbers in front of or behind the slash. It also tells me the data is then in the wrong format if I click in the old box (obviously) because it is missing required digits at the beginning or end then.

Is there a way to not have my old data change but allow for new 5 digit numbers to be entered?
Jul 31 '14 #1
3 1625
zmbd
5,501 Expert Mod 4TB
What is the typecast of the field in the table (long, text, etc...). I'm suspecting that you have a numeric field type from post.
Jul 31 '14 #2
NeoPa
32,556 Expert Mod 16PB
I don't believe it's possible to have a single input mask that covers both styles of data. Essentially they are incompatible.

Is it practical to update all your existing data to 5 digits with leading zeroes then use that format going forwards? If not then you appear to be suffering from the problem (too frequently come across) of failing to allow for expansion in the original design.

If scrapping and starting again is not possible then you could consider losing the input mask completely and using VBA to check and format your data when input.
Aug 3 '14 #3
zmbd
5,501 Expert Mod 4TB
neopa,

If the field type is numeric, then as you said. I suspect from what OP has posted, the field is Numeric(long). This is because the literal "/" in OP's data isn't stored in the numeric field and the mask will by default fill right to left with data display.

The other issue with the numeric, by definition, leading zeros are ignored in whole numbers. 0##### > #### not matter what OP does, the second 0 in the entry is of course a non-issue, and OP will still have data entry and display errors.

With a Text field, then the input mask can be worked around and in-fact should not effect the old data (at least I've not seen it happen in the databases I oversee); however, old data would have to be updated upon edit to match the new data format or changes abandoned. To clarify of in a TEXT we had 1234/5678 and OP needed to change this to 1239/5678 OP would have to update the field to some variation of #1239/#5678 or abandon the change.

My suggestion for OP is to take the single field and split it into two fields and join in the query with formatting as needed.
The data entry form's text box for data entry would hold the input mask and then using VBA take the input, string split(), and store into the correct fields.

Now why do I know this... We used to have fields that an old designer had the numeric count for three types of bacteria recorded in... some of these fields were text because we would enter TNTC and others were numeric and with various input masks... it's not normalized, and is absolutely a nightmare to maintain. I'm still trying to get them to reconsider moving to a normalized database. One more holdout and when retired I think I'll have a chance... five years and counting +)
Aug 3 '14 #4

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

Similar topics

1
by: Miranda Evans | last post by:
In my application, a text box control resides in a form. The text box control is unbound, but--assuming all edits are passed when the user click a command button on the form--the contents of the...
2
by: johnp | last post by:
Hi, Our Tech department updated users to Office 2003 this week. Now the input mask in one of the applications is showing up as: (###) ###-### The input mask wizard works correctly when I...
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!
3
by: AA Arens | last post by:
When I want the first character of a field to be Uppercased, I need to make an input mask, like >L< followed by ??????? for example. But this mask creates ____ in an unfilled field, which I don't...
2
by: jmarr02s | last post by:
I need my Date field to possess the following format: Jan-05-1999 How do I change the Date Format/Input Mask to accomplish this? Thanks! John
5
by: mtgrizzly52 | last post by:
First thing, because of you all and this web site, I am building a first class time saving database for my fellow workers to use. My really dumb questions is this. I have a control in a subform...
7
desklamp
by: desklamp | last post by:
I'm a total Access newbie, please bear with me! Using Win2K/Access 2003. I'm trying to create a table in which I can store IP addresses and other information. According to Microsoft, there is no...
5
by: theunsgoosen | last post by:
Access beginner, Hi, Im using code to unlock information so the user can change the information. I also need the input mask to change from "password" to "text", but im struggling with that specific...
1
by: Doug | last post by:
Hi, I created a short date field. The format is dd/mm/yyyy when displayed. The input mask is set to 99/99/00;0 (default, I didn't type anything). If I edit an existing date, say change...
3
by: James Grant | last post by:
Hi Everyone, Like many others before me I have the often asked question of how to create an 'Access-like' input mask for hastening date data entry. Using C Pearson's much quoted code I've...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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...
0
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...
0
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...

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.