Hi Ian,

Note that I search for " in " rather than "in".

To get the right portion of the field:

Mid(fieldname,instr(fieldname," in ")+4)

The reason you need Mid rather than Right:

Right("abcdefg",5) returns the last 5 characters: "cdefg"
Mid("abcdefg",5) returns characters from position 5 to the end: "efg"

As someone else posted, you can use Chr$(13) & Chr$(10) instead of 
vbCRLF when writing SQL.  Because vbCRLF is a visual basic constant, 
it's not recognized in Jet SQL.

Peter


--- In [EMAIL PROTECTED], "ian_stevenson100" 
<[EMAIL PROTECTED]> wrote:
>
> Hi Peter,
> I'd like to do in code if it is possible. After looking around the 
> web i found the following bit of code Left(fieldname,instr
> (fieldname,"in")-1) Basically this returns all the text to the left 
> of the word "in" then i was going to do a vbclrf but i don't know 
> how i can return just the word "in" on the next line.Also i tried 
to 
> do the following Right(fieldname,instr(fieldname,"in")-1) so it 
> would return the text after the word "in" but unfortunately one of 
> the college awards is called "Postgrad in Learning disabilities" 
and 
> what that code did was from the right hand side look at the text 
and 
> find the word in but it returned "ning disabilities" as it 
> see's "in" in the word learning. I hope it doesn't sound to 
> complicated?
> 
> --- In [EMAIL PROTECTED], "phoogenb" <phoogenb@> wrote:
> >
> > Hi Ian,
> > 
> > The CanGrow property only affects textboxes on reports.
> > 
> > You can type the line breaks into the textbox with ctrl+enter.
> > 
> > If you want to insert them in code, it's a little more involved.  
> Let 
> > us know if that's what you want and I'll have a stab at it.
> > 
> > Good luck,
> > 
> > Peter Hoogenboom
> > 
> > --- In [EMAIL PROTECTED], "ian_stevenson100" 
> > <ian_stevenson100@> wrote:
> > >
> > > HI everyone,
> > > 
> > > I hope someone will be able to help me with this one as i'm 
> pretty 
> > > new to using access. I am producing a report which prints out 
> > > various college awards a person has received. I am using a text 
> box 
> > > to hold the award and have the property can grow set 
to 'Yes'.So 
> it 
> > > looks like this 
> > > 
> > > Name : John Doe         Year :2006
> > > 
> > > Award : Postgraduate Diploma in Addiction
> > >                      Studies.
> > > 
> > > What i want is have the layout of the Award to be like this
> > > 
> > > Award : Postgraduate Diploma
> > >                in
> > >           Addiction Studies.
> > > 
> > > So basically i want the words before the word "in" on a 
seperate 
> > > line and then the word "in" on a seperate line and then the 
rest 
> of 
> > > the words after "in" to be on a seperate line. 
> > > 
> > > I hope i have explained my self correctly and any help would be 
> > > appreciated.
> > > 
> > > Thank you
> > >
> >
>


Reply via email to