Identify Serial Numbers

  • Thread starter Thread starter Anand
  • Start date Start date
A

Anand

Hi all,
I am using an A2k Application. I have a text box in which
the user enters a set of Serial Numbers. These serial
numbers could be individual numbers separated by a comma
(100, 101, 102) or a range of numbers (100-102) or a
combination of both (100, 101-104, 105).

I want to know if there is any way I can identify the
values in the text box and make a series of UNIQUE numbers
out of them.

I am not sure that they will be consecutive numbers nor am
I sure that they will be in ascending or descending
order. I am sure that the range will be defined by a "-"
and only commas will be used to separate the Serial
Numbers/Range of Serial Numbers

Can this be done? Is it too ambitious?

Many TIA
Anand
 
Might involve a fair bit of VBA coding.
First you have to parse the input string looking for commas, between which
you will presumably find single numbers or pairs separated by "-". Use the
Split function to return an array of these.
Then you have to check for "-" characters using the InStr function and
assign a range from the starting and ending number ( hopefully only two ) at
each end. And check and possibly re-order the numbers if someone enters
102-85.
Depending on how paranoid you are, you may want to check for other
separators as well.
Once you do this, generating a series of numbers is the easy part.
--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Did you get an answer yet? I think you would have to parse the string code.
If the serial numbers are actually numbers that wouldn't be too hard to do
if you are adapt at coding using string functions. Where do you want to
store the numbers once you have them?

Bob

PS: I might just write a function for you if you still need it.
 
Thanks Bob,
I did get a reply from Adrian Jansen. It seems like a fair
bit of work. Need to keep check of many issues.

The serial numbers relate to equipments that my company
manufactures. Each equipment has a unique serial number.
So if I have an order for 100 pcs I would love to simply
allot serial numbers like 101-200 and the system should
store 100 records in a table. Ill use these 100 records
to track serial numbers of the components that go into
each equipment... does all that make sense?

Let me try out the tips. Ill let u know if I am stuck
anywhere. You can write that function for me then.

Thanks agn.
Anand
 
Back
Top