almost done

J

James Warpup

Sry to bother you guys again, I know you're busy.

I want to match a word to a string and then change part of the word. lets
take "parler" (to speak).

all i want to know is how can i set a variable to equal any number of
charicters before a given value. For example if a control contains the
value "parler" I need to set a variable = "parl" if it's "aider" i need
the same variable to = "aid". if it's intercéder the variable shold =
"intercéd"
 
M

Marshall Barton

James said:
Sry to bother you guys again, I know you're busy.

I want to match a word to a string and then change part of the word. lets
take "parler" (to speak).

all i want to know is how can i set a variable to equal any number of
charicters before a given value. For example if a control contains the
value "parler" I need to set a variable = "parl" if it's "aider" i need
the same variable to = "aid". if it's intercéder the variable shold =
"intercéd"


Your examples can be done by using Left(word, Len(word)-2)
 
J

Jeff Boyce

James

Do you have a fair number of these? If so, consider creating a table which
holds the 'translations'.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

Mike Painter

James said:
Sry to bother you guys again, I know you're busy.

I want to match a word to a string and then change part of the word. lets
take "parler" (to speak).

all i want to know is how can i set a variable to equal any number of
charicters before a given value. For example if a control contains
the value "parler" I need to set a variable = "parl" if it's "aider"
i need the same variable to = "aid". if it's intercéder the variable
shold = "intercéd"
Replace ( string1, find, replacement, [start, [count, [compare]]] )
Replace( "YourString", "parler","parl") if you want to do it in the string
and replace all occurances.
Replace( "YourString", "parler","parl", 3, 2) would replace the third and
fourth occurances of the word.
 

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