Not sure if this is a silly question or not but anyone tell me if you can compare and strip txt and numbers from a String Variable.
I have in my Db two different results codes. One for people Hair analysis (a number code like2980..) and one for Misc analysis (could be anything from dust, skin to dog, cow hair, being txt prefix and and a number e.g. C102, Du250 etc..).
The Misc code can come back from the Lab mixed with the People ones and is in one field which I import to a temp table and match it with its record in its table and is therefore a String Field to cater for the txt part of the MiscCode.
However when stored in the 'MiscLabRegister' table it is stored as two seperate parts, Subjectcode (txt part) and the SubjectCodeNumber (number part) and concatenated into one when shown on the forms.
I do this to make it easier to increment the number and choose which txt prefix depending on the type of analysis it is.
I know it would probably be easier to use an array which each element could be manipulated, but I am a novice learning programmer and completely self taught, and arrays are something I havent quite got my head around yet.
But if there is a way I can step through the elements of a variable and strip the identified ones out it would be simple.
If anyone has a an easier way to do the whole thing I would love to hear it. Just bear in mind that the 'Code' can contain both the plain number code and the txt prefix code and that I need the Misc code saved split into the table as the txt part and the number part, all else is subjective.
Heres a visual on the data in case my longwinded explanations are confusing lol.
From lab: Code
2980
2981
C108
DU58
Pure numbers (and associated data) saved to LabRegister Table in one field called 'Code'
Misc Codes (and accociated data) are saved as
'SubjectCode' 'SubjectCodeNumber'
C 108
DU 58
Thanks
Ollie
I have in my Db two different results codes. One for people Hair analysis (a number code like2980..) and one for Misc analysis (could be anything from dust, skin to dog, cow hair, being txt prefix and and a number e.g. C102, Du250 etc..).
The Misc code can come back from the Lab mixed with the People ones and is in one field which I import to a temp table and match it with its record in its table and is therefore a String Field to cater for the txt part of the MiscCode.
However when stored in the 'MiscLabRegister' table it is stored as two seperate parts, Subjectcode (txt part) and the SubjectCodeNumber (number part) and concatenated into one when shown on the forms.
I do this to make it easier to increment the number and choose which txt prefix depending on the type of analysis it is.
I know it would probably be easier to use an array which each element could be manipulated, but I am a novice learning programmer and completely self taught, and arrays are something I havent quite got my head around yet.
But if there is a way I can step through the elements of a variable and strip the identified ones out it would be simple.
If anyone has a an easier way to do the whole thing I would love to hear it. Just bear in mind that the 'Code' can contain both the plain number code and the txt prefix code and that I need the Misc code saved split into the table as the txt part and the number part, all else is subjective.
Heres a visual on the data in case my longwinded explanations are confusing lol.
From lab: Code
2980
2981
C108
DU58
Pure numbers (and associated data) saved to LabRegister Table in one field called 'Code'
Misc Codes (and accociated data) are saved as
'SubjectCode' 'SubjectCodeNumber'
C 108
DU 58
Thanks
Ollie