A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Right or Left Question



 
 
Thread Tools Display Modes
  #1  
Old June 9th, 2006, 03:51 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old June 9th, 2006, 04:03 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old June 9th, 2006, 05:34 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old June 9th, 2006, 08:41 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 06:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.