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

Question about entering numbers without 0 in the beginning

I have created database in which my first field in the table is item number which has more than 15 numbers. so I used Text instead of numbers. Item number is primary key to avoid duplication. but the problem is when I scan the numbers some start with 0 and some don't. it is accepting both. when I scan from the box it starts with 0. but same item if I scan by label it doesn't start with 0. so numbers are duplicating now. For instance when I scan from box, it is 089674534, but same item when I scan from label it shows as 89674534. We get chance to scan item more than 3 times. so this number should show as duplicating but just because it takes with 0 and without o, it takes same item as different number. Can anyone give me idea how i can enter without 0. do I have use any query or do some changes in properties. for instance even if i scan from box it should eliminate 0 and take only other following numbers.
Apr 16 '11 #1
3 2189
TheSmileyCoder
2,322 Expert Mod 2GB
A function such as this could strip the zero's for you.

Expand|Select|Wrap|Line Numbers
  1. Public Function Trim0(strInput as string) as String
  2. Do while Left(strInput,1)=0
  3.  strInput=mid(strInput,2)
  4. Loop
  5. Trim0=strInput
  6. End Function
Apr 16 '11 #2
thanks for the reply. but can you please let me know where exactly i am sriting tis function?
Apr 19 '11 #3
TheSmileyCoder
2,322 Expert Mod 2GB
You write this in a separate module. Then you can call the function from wherever you need it.
Apr 19 '11 #4

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

Similar topics

4
by: wenjie wang | last post by:
Greetings, I'd like to know is there any situation where your program could crash without reaching the breakpoint which you set at the beginning of main().
8
by: Shawn | last post by:
I have an application that will use barcode scanners to enter an ID to search a database. The main form uses a tab page. I would like people to go to the tab for checking in and just read the...
16
by: codergem | last post by:
How to add two numbers without using the plus operator?
14
by: Maxximvs | last post by:
G'day Having a day where the brain noodle will not comprehend so I though I'd post the question. I have a table (called Vendors) which has two fields (Sequence, a unique number but not marked...
4
by: carlos123 | last post by:
i need a formula to generate 100 random numbers 1-20 any suggestions?
1
by: gobblegob | last post by:
Hi guys i am trying to randomize 6 numbers into 6 textboxes up to the value of 60 without repeating a number but i dont know how an error handler would work for duplicate numbers any idea's? this...
4
by: Astley Le Jasper | last post by:
I've been getting errors recently when using pysqlite. I've declared the table columns as real numbers to 2 decimal places (I'm dealing with money), but when doing division on two numbers that...
6
by: Nethra Nayak | last post by:
How to Write a C program to find the smallest of three integers, without using any of the comparision operators.?
15
by: capablanca | last post by:
Hi How to create a program that ask to the user enter 10 numbers and the program can form all the combinations of 5 numbers without repeating. Thanks for any advice.
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
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,...
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
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
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.