var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Retrieving the last word in a field
Is there a function that will retrieve the last 'word' typed in a field.
"My name is Anna" = "Anna"
"My father's age is 56" = "56"
The function 'rightwords' doesn't seem to exist in Access.
Thankyou for reading and eventually answering my question.
try len() and instr() (not sure if im 100% correct these are from VB6 but should be something like this in exl
or some thing liek a loop backwards
S="Today is monday"
for j = i to 1 step -1
if mid() exit for ' use mid here to see if the chr is a space
Sorry didnt really have time to test this,,
u may also be able to split the string based on spaces into an array and then just return the last item in the array,,
i havent done that in xl either but in dot net so... im sure there is a way
If you are doing this in Excel (rather than Access), then try this formula.
=IF(LEN(A1)-LEN(SUBSTITUTE(A1," ",""))=0,A1,RIGHT(A1,LEN(A1)-FIND("*",SUBSTITUTE(A1," ","*",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))))
[Edited to note that the target cell is A1, and you can put this formula into B1. Adjust as necessary.]
Last edited by shades; 01-12-04 at 13:05.