Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create field to Strip text

Status
Not open for further replies.

coopsman

Technical User
Apr 5, 2002
9
US
I would like to create a field in a Microsoft Access query that does the following:

If Right([Manager],5)="Funds", then remove "Funds", If Right ([Manager]),3)="Fds", then remove "Fds". Is there a way to easily remove x number of characters when a condition is met as in the above example? Thanks in advance for any help!
 
Dim intLen As Integer
intLen = Len([Manager])

If Right([Manager],5) = "Funds" Then
[Manager] = Left([Manager], intLen - 5)
Else If Right(Manager],3) = "Fds" Then
[Manager] = Left([Manager], intLen - 3)
Else
'?
End If
"The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
930driver seems to be right
have this as a public function in module
and call this one of select fields in query
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top