InStr

G

Guest

Hi
Basic MS Access apprentice here
How do I get the 'first rightmost char - ' ' - in a text
string in a msaccess regular table?
For leftmost I do: left([col],InStr([col],' ') ...
(sorry 'bout the ,/; thing...)
TIA
Ricardo Gomes
 
T

Tom

didn't really understand what you're trying to do but the function right(<string exp.>,<no. of characters>) does exactly the opposite from left(...
hope this is what you meant...
 
D

Dirk Goldgar

Hi
Basic MS Access apprentice here
How do I get the 'first rightmost char - ' ' - in a text
string in a msaccess regular table?
For leftmost I do: left([col],InStr([col],' ') ...
(sorry 'bout the ,/; thing...)
TIA
Ricardo Gomes

If you're using Access 2000 or later, you can use the InStrRev function,
which searches the string from right to left.
 
G

Guest

Imagine my name, «Ricardo Alexandre Lino Gomes» kept in
some «Names» table...
My goal is to extract «Gomes», no matter how many middle
names the name contains.
TIA
Ricardo
 
G

Guest

Nothing like addressing the right person.
Many thanks.
(my online help contains no such function, hence my
problem...)

See Ya 'round.
Ricardo
-----Original Message-----
Hi
Basic MS Access apprentice here
How do I get the 'first rightmost char - ' ' - in a text
string in a msaccess regular table?
For leftmost I do: left([col],InStr([col],' ') ...
(sorry 'bout the ,/; thing...)
TIA
Ricardo Gomes

If you're using Access 2000 or later, you can use the InStrRev function,
which searches the string from right to left.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


.
 
D

Dirk Goldgar

Imagine my name, «Ricardo Alexandre Lino Gomes» kept in
some «Names» table...
My goal is to extract «Gomes», no matter how many middle
names the name contains.

strSurname = Mid(strFullName, InStrRev(strFullName, " ") + 1)
 
D

Dirk Goldgar

Nothing like addressing the right person.
Many thanks.
(my online help contains no such function, hence my
problem...)

The online help *is* terribly indexed, but the content is there. If you
open the help from the VB Editor environment, you should be able to find
the InStrRev function under "Visual Basic Language Reference" ->
"Functions" -> "H-L". And if you know the name of the item you want to
look up, just type the name in a module or in the immediate window, then
click it (or "arrow back" into it) and press F1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top