473,468 Members | 1,472 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Could not start number field with 0?

55 New Member
Hi,

I have a field to enter mobile number (10 digits) for customers and it starts with '0'
whenever i enter the number, it does not accept zero at the front.
if i enter: 0411111111, it will end up like-- 4111111111

how should i rectify this??
can anyone help in this regard,

thanks,
catherine
Aug 30 '07 #1
6 18949
Jim Doherty
897 Recognized Expert Contributor
Hi,

I have a field to enter mobile number (10 digits) for customers and it starts with '0'
whenever i enter the number, it does not accept zero at the front.
if i enter: 0411111111, it will end up like-- 4111111111

how should i rectify this??
can anyone help in this regard,

thanks,
catherine

Set your data type field size to 'double' and in the FORMAT type 0000000000

Jim
Aug 30 '07 #2
missinglinq
3,532 Recognized Expert Specialist
Simply set the datatype to Text! Just because a field holds digits doesn't mean it should be defined as numerical! It doesn't need to be defined as a numerical datatype unless it's to be used in mathematical calculations!

SSNs, ID numbers, phone numbers, etc. are not numerical data!

Linq ;0)>
Aug 30 '07 #3
ontherun
55 New Member
Simply set the datatype to Text! Just because a field holds digits doesn't mean it should be defined as numerical! It doesn't need to be defined as a numerical datatype unless it's to be used in mathematical calculations!

SSNs, ID numbers, phone numbers, etc. are not numerical data!

Linq ;0)>
hi,

thanks for your reply.
I tried both the options but i have entered some records with my previous settings.
so some of the mobile no have been saved as 411111111 instead of 0411111111

now when i change the data type and save the table, i tried to change the values but it is not allowing me still.

what could be the reason?

waiting for your reply.

thanks,
catherine
Aug 30 '07 #4
ontherun
55 New Member
hi,

thanks for your reply.
I tried both the options but i have entered some records with my previous settings.
so some of the mobile no have been saved as 411111111 instead of 0411111111

now when i change the data type and save the table, i tried to change the values but it is not allowing me still.

what could be the reason?

waiting for your reply.

thanks,
catherine
Hi there,

I checked in the tables and all mobile numbers starts with 0 as i entered for the first time. like

but when i open in forms, the same mobile numbers does not start with 0.

am totally confused
Aug 30 '07 #5
Jim Doherty
897 Recognized Expert Contributor
Hi there,

I checked in the tables and all mobile numbers starts with 0 as i entered for the first time. like

but when i open in forms, the same mobile numbers does not start with 0.

am totally confused

Miss Ingling is 100 percent correct!

My answer based on your question how do I store a mobile NUMBER where it allows you to display the leading zero is answered by my posting ie double using 0000000000 as the format does gives it you visually. MissIngling properly points out that the datatype storage text should have been the datatype of choice in the first place.

My 'assumption' based on your specific question was that you might have chosen numeric for a particular specific reason ie: a MOBILE number is hardly likely to have an alpha character in it which, if this had been your concious choice, would give you the advantage of easy SORTING over a 'massive' dataset processing quicker than text based on WHERE clauses and so with =><<> operands etc.

I have no way of knowing what might prompt cause you to use numeric but you obviously have and looking at my posting compared with Miss Ingling looks as though I am giving you WRONG advice.

IT IS a question as has been quite rightly pointed of suitably determining your datatype requirement properly in the 'first place' in the full knowledge of how each datatype reacts. With TEXT based overall you have no problem entering and/or validating on a string length of TEN digits all of which must be numbers containing no inadvertent spaces, unwanted characters etc etc and their are various ways to do that.

In your specific situation you see the numbers in the table per se displayed now as you want but the FORM control ie the textbox doesnt see it that way, it sees it as a number, but not its format.

The format property for the textbox control if set to 0000000000 will display any number as entered as a TEN sequence so the number 345 will show as 0000000345. IF you are content with this and it suits your purpose.... then you make the choice..... but if not and it of course may not be suitable, then you convert the existing data to text based, deal with historical data not having a leading zero by whatever means is at your disposal and go for validating the text string number for future inserts its up to you

Hope I have qualified myself sufficiently so as NOT to potentially steer you down the wrong route. Bottom line is you must know HOW your datatypes behave and how you can successfully query on any data reproduced before committing data to it.

Example: Using the NUMBER method you will never be able to simply type 0000087345 as criteria in the Access query grid because Access will throw the leading zeros away leaving you with 87345 you' would still get a return dataset of course but you might think "hmmmm why did it do that"...it does it because its a number!!

I hope this qualifies my earlier one line posting to you?

Regards

Jim
Aug 30 '07 #6
ontherun
55 New Member
Miss Ingling is 100 percent correct!

My answer based on your question how do I store a mobile NUMBER where it allows you to display the leading zero is answered by my posting ie double using 0000000000 as the format does gives it you visually. MissIngling properly points out that the datatype storage text should have been the datatype of choice in the first place.

My 'assumption' based on your specific question was that you might have chosen numeric for a particular specific reason ie: a MOBILE number is hardly likely to have an alpha character in it which, if this had been your concious choice, would give you the advantage of easy SORTING over a 'massive' dataset processing quicker than text based on WHERE clauses and so with =><<> operands etc.

I have no way of knowing what might prompt cause you to use numeric but you obviously have and looking at my posting compared with Miss Ingling looks as though I am giving you WRONG advice.

IT IS a question as has been quite rightly pointed of suitably determining your datatype requirement properly in the 'first place' in the full knowledge of how each datatype reacts. With TEXT based overall you have no problem entering and/or validating on a string length of TEN digits all of which must be numbers containing no inadvertent spaces, unwanted characters etc etc and their are various ways to do that.

In your specific situation you see the numbers in the table per se displayed now as you want but the FORM control ie the textbox doesnt see it that way, it sees it as a number, but not its format.

The format property for the textbox control if set to 0000000000 will display any number as entered as a TEN sequence so the number 345 will show as 0000000345. IF you are content with this and it suits your purpose.... then you make the choice..... but if not and it of course may not be suitable, then you convert the existing data to text based, deal with historical data not having a leading zero by whatever means is at your disposal and go for validating the text string number for future inserts its up to you

Hope I have qualified myself sufficiently so as NOT to potentially steer you down the wrong route. Bottom line is you must know HOW your datatypes behave and how you can successfully query on any data reproduced before committing data to it.

Example: Using the NUMBER method you will never be able to simply type 0000087345 as criteria in the Access query grid because Access will throw the leading zeros away leaving you with 87345 you' would still get a return dataset of course but you might think "hmmmm why did it do that"...it does it because its a number!!

I hope this qualifies my earlier one line posting to you?

Regards

Jim

thanks Jim. that gives me a clear understanding of where i went wrong and what exactly i should do.

thanks a lot again..

i'll follow your steps as stated.

have a good weekend

regards,
Catherine
Aug 30 '07 #7

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

Similar topics

3
by: Kangol kangoll | last post by:
hi, i've been trying to figure out how to make visual basic start extracting text at a certain line to when i tell it to stop. I am making trying to make a program where it extracts text from a...
3
by: Joeandtel | last post by:
Is there a way to start the Primary Auto_Number at a specific number? Usually it starts at 1, but I would like to have it start at 5,000
15
by: Pasta Bolognese | last post by:
Open VS.2003. Click on a control on an aspx page in the HTML view. Does it tell me the pixel position on the page? Nooooooooooo.................
1
by: Koen | last post by:
Hi all, I created a little database to manage my e-books. The program will synchronize a table with the contents of a directory. Works great. Because I keep additional info (like keywords) to...
16
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number...
20
by: ctyrrell | last post by:
Does anyone have any idea how to recover from a run-time error 3002 which I get after creating a workspace 242 times? Or better yet, avoid getting it in the first place? I am creating a...
9
by: boliches | last post by:
I have a seperate table to generate consecutive numbers. Using "Dmax" to find the largest number to increment . My problem is that I want the number to begin at 1000 at the start of each month,...
3
by: Strasser | last post by:
In a nested subform in datasheet view, an interviewer of homeless people picks a descriptive CATEGORY from 20 descriptive categories. The 20 categories are displayed via a combo box. (Categories...
3
by: Himmel | last post by:
I have added a section of code to a function that is designed to copy data from several tables and place them into a single table. The new table already contains a unique ID and name, and I am...
1
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...
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
Oralloy
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,...
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
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
agi2029
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,...
1
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: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.