function help

yessir

Saved By Grace
Local time
Today, 18:57
Joined
May 29, 2003
Messages
349
I am looking to make a function where you hand it 2 strings (single words) and return a string.

The strings are to be compared in that the first is the string to test and second is to compare to.

What it needs to do is take the RIGHT 2 characters from the first string and compare it to the second (like).
If they are alike then return the 2 characters.
If not, compare the right 3, 4, .... till there is an alike to return.

Can someone help with this?

Thanks
~ Lost
 
Trim the strings, get the 'len's (function), 'for next' loop through them, using right$ and midstring$ to test. (?)
 
can you help a little more with that?
 
Read up on:

Len() function
Right() function
Mid() function
For Next Loops

Hope this helps...
 
In the first form in the included db there is a button called command30.
This is where I am testing my code.

I tried using 'If .. Like .. Then' inside a loop and it worked once ( :eek: ) but it doesn't. I am wondering how I can accomplish this?

I got the compare to work, check out modcompstring.

A little more help would be greatly appreciated...

Thanks
~ Getting Closer
 

Attachments

just a note,

this is the answer:

If InStr(1, rec("ClientID"), vtemp) > 0 Then
 

Users who are viewing this thread

Back
Top Bottom