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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Substring or Substr function in VBA

Status
Not open for further replies.

iainmc

Programmer
Dec 2, 2002
53
GB
Hi,

Does anyone know if a substring or substr function exist in MS Access 97?
I have looked in the help but can't find one.

Any ideas, thanks.
 
If you mean the substring function as used in e.g. SQLServer-QueryAnalyzer, the VBA equivalent is the MID function.

usage:
Mid(string, start pos, [length])
leaving away the length value will return the rest of the string from start pos till the end

Mid("Steven",3) will return "even"
Mid("Steven",1,5) will return "Steve" and
Mid("Steven",3,3) will return "eve"

Is it that you meant?
;-)

Andreas

[blue]The last voice we will hear before the world explodes will be that of an expert saying:
"This is technically impossible!" - Sir Peter Ustinov[/blue]
HP:
 
Have a look at the functions :-
Left(), Right(),Mid()


Regards
BrianB
Use CupOfCoffee to speed up all windows applications
================================
 
That is waht i meant, yes.

Thank you for your help. Legend!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top