Using 'truncate' in VBA

grahamw

Registered User.
Local time
Today, 12:54
Joined
Aug 19, 2005
Messages
23
Hi all. Id be grateful for any help on the following:
I have a number of text cells in my database (data type: text) some of which include a ' +' after the text. I would like to pull out the text without the ' +' attached. Does VBA have a truncate or 'cut off' command that can be used.
Or should I have done this task in excel before importing into the access table. Any thoughts would be appreciated.
Best Wishes,
Graham, London
 
Ive worked out using the left, right commands.
However, I need to import everything to the left of the '+' sign so I
cant just set the left command up to a fixed number of characters
Any thoughts please?
 
If the "+" is always on the end of the string then how about:
Replace(YourField,"+","")
 
grahamw,

Use as a new field in a query, or in SQL statement to Update your table:

IIf(Right([YourField], 1) = "+", Left([YourField], Len([YourField]) - 1), [YourField])

Wayne
 

Users who are viewing this thread

Back
Top Bottom