If Else????

Access_help_rob

Registered User.
Local time
Today, 13:43
Joined
Jul 3, 2003
Messages
66
Hey there here is what im trying to do that i need help with.
I want to check my stock code field check the 2nd from last character, IF it equals a / then remove last 2 characters, else remove last 3. Can anybody help me with this code and where i will put it?
thanx
rob
 
Hi

dim StrA as string

StrA = "AWORD/AA"

if mid(stra,len(Stra)-2,1) = "/" then

stra = left(stra,len(Stra)-2)

else

stra = left(stra,len(Stra)-3)
Msgbox "It works"
end if

You may have to mess about with the -Num to pick the correct letter but the ideas there.


Chris
 

Users who are viewing this thread

Back
Top Bottom