Remove letter from text field

sroot

Registered User.
Local time
Today, 10:41
Joined
Mar 18, 2013
Messages
53
Good morning! I am trying to get something done in a database and i am stuck on one part that i am hoping someone can help with. The part i am stuck on is basicly i have a form with 2 text boxes, they need to scan in the first and last work ticket into them and then dump anything in between the numbers into a table. The problem is that when you scan them they have a M in front of the numbers. So Text0 would have M853420 in it and Text2 would have M853425 in it, and then hit a button and export to table1 853420, 853421, 853422, 853423, 85344, and 853425... Is there any way to do this?

Thanks for any help
 
I can think of two ways.

use the Mid function
Code:
tt="M853425"
? mid(tt,2)
853425

or the Replace function
Code:
? replace(tt,"M","")
853425

Then just write the records between those values.

HTH
[/code]
 
Assuming the numbers are always sequential and there is only one letter in front of them then
Code:
cLng(Right([YourScan], (len([YourScan])-1)))

Will change the string into the number you want.
You will then need a VBA loop to create an IN() phrase to then insert the records with those values. Does that help?
 
Why not strip out the M when you scan the start and finish numbers.
 

Users who are viewing this thread

Back
Top Bottom