hello all!
I have a table in access 2010 that it contains a column with a short code, and it required only 6 digits not less than and not more than 6 it must be fix 6 numbers (e.g 123456) this is correct, but (e.g 1234567) NOT correct,
I don't know how to mask this please help Me as soon as possible
11 4354 zmbd 5,501
Expert Mod 4TB
open the table design
select the field
select the validation field
press [f1]
also Allen Brown - Validation Rules
I would also consider doing this kind of check at the form level.
You can do this using "Input Mask" control.
Select your field and enter 6 times "0"
(with 0 means : y0u can enter Digit (0 to 9, entry required, plus [+] and minus [–] signs not allowed).
As mentioned by Z: You can see more option pressing F1.
NeoPa 32,556
Expert Mod 16PB
The Input Mask property you would use for that would simply be "000000". Quotes (") not required.
I have tried it all the options, but positive result, still when I'm insterting number in that field it accepts, more and less than 6 numbers
i want this field only accepts 6 digits of number (NO more/less)
Did you try the validation rule Is Null OR Between 100000 And 999999? If the control must have a value in it, you can skip the Is Null portion to leave just Between 100000 And 999999.
This was found in Z's link and I would be very much surprised if it didn't work. Be sure to read the link and also read the section When to use validation rules, Field's validation rule. It provides some good insight about considerations you need to make before using validation rules.
NeoPa 32,556
Expert Mod 16PB Access InputMask Help:
0 - Digit (0 to 9, entry required, plus [+] and minus [-] signs not allowed).
I'm surprised you say it doesn't work for you. I can only assume you have not entered it correctly. I thought the instructions were very explicit. Don't enter any quote characters into the InputMask property, but just six zeroes. You should find that works for you.
zmbd 5,501
Expert Mod 4TB
Using the formating alone with a numeric-long field will still allow the use of the negative sign while preventing the use of alpha and most other non-numerics; thus a combination of the format mask as you suggested and the validation rule ">=0" would allow "000000" thru "999999" in that even if the user enters only a numeric "5" the formating would give "000005" and preventing the use of a negative.
In this case, if I understand OP correctly, then he needs to prevent an empty entry, check for a positive, and use the validation rule instead of the mask. All of this is covered in the link I provided.
As this is almost a basic Access homework assignment, I must ask MMWIT to please post/clearly describe your efforts before we go any further.
NeoPa 32,556
Expert Mod 16PB
I think you may be mistaken there Z :-(
A formatted result would not change the underlying value as an InputMask would, and would not give the required results. The question asks for a Mask, and I believe an InputMask (of 000000) is the only fully appropriate answer. I would expect the field used to be of type String and of length six, rather than any type of numeric field at all.
zmbd 5,501
Expert Mod 4TB
Neopa,
Why would you expect a text-classed field instead of a numeric?
OP: be fix 6 numbers
It is illogical to store numeric information within a text-classed field.
As for which of us has a valid statement/solution. This is answered as a "both/and" not an "either/or" given the correct context as follows:
My statement is true given a numeric-long field.
Your statement is true given a text field.
-> I have tested this in V2010 just to see what was what, in that if you had a valid statement within a numeric field then I’d be in serious poop with some of my databases as I have literally thousands of entries that depend on the validation rules being correct and we'd be in serious trouble under ISO certifications if there was something wrong with how I've implemented these at the table level (ok, deep breath, happy place, I'm in my happy place, no bad ISO auditors today, Ice-cream and butterscotch, hot fudge...hmmm – ROTFL – no seriously, there’d be a very un-happy hour or three in my supervisor’s office if something was wrong.)
:-)
SO, My reply was based upon OP's post #5 which leads me to, two things, that OP is using a numeric field, and that OP has placed the formatting string (if used) and the validation strings in the wrong place... if at all, and has used the wrong string.
NeoPa 32,556
Expert Mod 16PB Z:
Why would you expect a text-classed field instead of a numeric?
Because it's common practice to use formatted number strings in IDs. Certainly not universal, but quite prevalent nevertheless. The benefits are that software is often designed to work with strings of a certain length. Reading through data of varying lengths can be harder on the brain. Invoice Numbers, for instance, are often text strings of n digits formatted with leading zeroes.
Bearing in mind the OP is no scholar of English, I'm not sure you can read too much into their comments in post #5. I really don't see where you find support, in there, for the idea the field is numeric, but whatever you glean from that is hardly reliable as the OP is clearly struggling to express themselves precisely in a foreign language.
Anyway, get back to your happy place, as I'm not here to cast aspersions on your logic, or even suggest your solution doesn't work. I merely believed that your understanding of what the OP actually wanted, was mistaken. That seems to me perfectly reasonable as we are all struggling to get a clear picture with the meagre crumbs of reliable information contained in their posts. That is not to criticise them for that. Asking technical questions in a foreign language is particularly difficult as we know from how many who fail so badly even when asking in their own language.
So, I have no doubt of your competence. I have no doubt that what you use works in the situations you've used them in. I merely doubt that those situations are the same as what the OP's asking about. Clearly you disagree (which surprises me if I'm honest), but I don't see that should necessarily be a problem. We may never find out what the OP really wants, but both solutions are visible in the thread, and if they don't both exactly match the question then they are still both valid in certain situations, so anyone reading the thread has an extra solution to make up for the lack of any meaningful question. A bargain in anyone's language.
In conclusion - ice cream served with a steaming hot portion of butterscotch fudge!
Set Schork thanks, its been solved
and Thank you all dears I have found the correct answer, and the problem is solved
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ellen Manning |
last post by:
I've got an A2K database with a link to a table in another A2K
database. This linked table contains SSN formatted with the SSN input
mask. I'm trying to use a dlookup using this linked table. ...
|
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...
|
by: Paul |
last post by:
hi,
is there an input mask i could use on a report to do the following:
(1) if i enter "THISISATEST" on my form, i want
the text box on my report to display: "T H I S I S A T E S T".
(2) if...
|
by: MS |
last post by:
The simplest input mask for peoples names is....
>L<??????????????
But what about when you have names like MacDonald, or Mary-Anne?
Anyone come up with a good "all round" "idiots" mask that...
|
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...
|
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!
|
by: BerkshireGuy |
last post by:
Is there a way to display what the expected format is before entering a
control.
For instance, if I have the input mask of 99/99/0000;0;#, it shows me
##/##/##, but only when I type the first...
|
by: Jon Peck |
last post by:
I'm largely self-taught (so hardly an expert) in Access 2002. I'm wondering
if it's possible to have a conditional input mask on a field in a form.
My database keeps track of people who register...
|
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...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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: 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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |