If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Right or Left Question
Hello,
I have a control that references data that looks like this: C:ABC/tuv/Testing I only want the Testing to show up. But the testing file may be different names and different lengths. My path is consistently 10 characters. Can someone please help on this? I assume I need to use left or right with Len, but I am not very experienced in that. Thanks much |
#2
|
|||
|
|||
Right or Left Question
You can do it with the Mid function ...
? Mid$("C:ABC/tuv/Testing", 11) Testing If you pass no value for the optional third 'Length' argument of this function, it reads to the end of the text. -- Brendan Reynolds Access MVP "Aaron" wrote in message ... Hello, I have a control that references data that looks like this: C:ABC/tuv/Testing I only want the Testing to show up. But the testing file may be different names and different lengths. My path is consistently 10 characters. Can someone please help on this? I assume I need to use left or right with Len, but I am not very experienced in that. Thanks much |
#3
|
|||
|
|||
Right or Left Question
I tried this in the control source box, but got an error:
=Mid([mwknif],10) mwknif is my control source field where my data is. I'm not sure what your ? and $ are for. Is it necessary syntax? "Aaron" wrote: Hello, I have a control that references data that looks like this: C:ABC/tuv/Testing I only want the Testing to show up. But the testing file may be different names and different lengths. My path is consistently 10 characters. Can someone please help on this? I assume I need to use left or right with Len, but I am not very experienced in that. Thanks much |
#4
|
|||
|
|||
Right or Left Question
Perhaps the name of the textbox is the same as the name of the field? If so, you'll need to change the name of the textbox. When used in the Immediate Window, '?' is shorthand for 'Print' and outputs the result to the Immediate Window. Several VBA functions have versions with and without the '$', e.g. Left and Left$, Right and Right$, Mid and Mid$. The difference is in the data type of the return value. The version without the '$' returns a Variant, the version with the '$' returns a String. If you want all characters after the first ten characters, your starting character will need to be 11, not 10. Mid([mwknif], 10) will include the tenth character in the output, e.g. "/Testing" rather than "Testing". -- Brendan Reynolds Access MVP "Aaron" wrote in message ... I tried this in the control source box, but got an error: =Mid([mwknif],10) mwknif is my control source field where my data is. I'm not sure what your ? and $ are for. Is it necessary syntax? "Aaron" wrote: Hello, I have a control that references data that looks like this: C:ABC/tuv/Testing I only want the Testing to show up. But the testing file may be different names and different lengths. My path is consistently 10 characters. Can someone please help on this? I assume I need to use left or right with Len, but I am not very experienced in that. Thanks much |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Left Join Not Properly | Pete | Running & Setting Up Queries | 7 | April 4th, 2006 02:19 PM |
left outer join - Question | Darryl | Running & Setting Up Queries | 3 | October 11th, 2005 05:03 PM |
Question about using the right or left formula | Jambruins | General Discussion | 4 | July 8th, 2005 10:15 PM |
Queries and joins | Ande | Running & Setting Up Queries | 3 | May 18th, 2005 01:29 PM |
JOINS | Ande | New Users | 2 | May 18th, 2005 03:39 AM |