Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Urgent: Count Line


Message #1 by "George Oro" <george@c...> on Sun, 16 Mar 2003 12:31:32 +0400
I have a field which the Enter Key Behavior is = New Line in Field and
sometimes the data is copy & paste from a memo field. I want to have a code
that should read only the first line of that Text Field.

For Instance:
This is my first line
This is my second line
and this is my last line

I want my code to return only "This is my first line" and disregard the
rest. Is there any way to accomplish this.

Any tips would be highly appreciated...


TIA,
George


Message #2 by "Enzo Zaragoza" <enzaux@g...> on Mon, 17 Mar 2003 08:52:08 +0800
Kabayang George,

	Make use of INSTR & MID

enzo c",)

-----Original Message-----
From: George Oro [mailto:george@c...]
Sent: Sunday, March 16, 2003 4:32 PM
To: Access
Subject: [access] Urgent: Count Line


I have a field which the Enter Key Behavior is = New Line in Field and
sometimes the data is copy & paste from a memo field. I want to have a code
that should read only the first line of that Text Field.

For Instance:
This is my first line
This is my second line
and this is my last line

I want my code to return only "This is my first line" and disregard the
rest. Is there any way to accomplish this.

Any tips would be highly appreciated...


TIA,
George






Message #3 by "George Oro" <george@c...> on Tue, 4 Mar 2003 08:49:26 +0400
Kabayang Enzo,

I tried but it doesn't work, can I see your idea maybe I missed something. 

TIA,
George


> -----Original Message-----
> From: Enzo Zaragoza [mailto:enzaux@g...]
> Sent: Monday, March 17, 2003 4:52 AM
> To: Access
> Subject: [access] RE: Urgent: Count Line
> 
> 
> 
> Kabayang George,
> 
> 	Make use of INSTR & MID
> 
> enzo c",)
> 
> -----Original Message-----
> From: George Oro [mailto:george@c...]
> Sent: Sunday, March 16, 2003 4:32 PM
> To: Access
> Subject: [access] Urgent: Count Line
> 
> 
> I have a field which the Enter Key Behavior is = New Line in Field and
> sometimes the data is copy & paste from a memo field. I want to have a code
> that should read only the first line of that Text Field.
> 
> For Instance:
> This is my first line
> This is my second line
> and this is my last line
> 
> I want my code to return only "This is my first line" and disregard the
> rest. Is there any way to accomplish this.
> 
> Any tips would be highly appreciated...
> 
> 
> TIA,
> George
> 
> 
> 
> 
> 
> 
> 
> 
Message #4 by "John Ruff" <papparuff@a...> on Sun, 16 Mar 2003 21:06:15 -0800
This should work George,

    txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField, vbCrLf) - 1)

John V. Ruff - The Eternal Optimist :-)
Always Looking For Contract Opportunities

www.noclassroom.com
Live software training
Right over the Internet

Home:  xxx.xxx.xxxx
Cell: 253.307/2947
9306 Farwest Dr SW
Lakewood, WA 98498

"Commit to the Lord whatever you do,
	and your plans will succeed." Proverbs 16:3



-----Original Message-----
From: George Oro [mailto:george@c...] 
Sent: Sunday, March 16, 2003 12:32 AM
To: Access
Subject: [access] Urgent: Count Line


I have a field which the Enter Key Behavior is = New Line in Field and
sometimes the data is copy & paste from a memo field. I want to have a code
that should read only the first line of that Text Field.

For Instance:
This is my first line
This is my second line
and this is my last line

I want my code to return only "This is my first line" and disregard the
rest. Is there any way to accomplish this.

Any tips would be highly appreciated...


TIA,
George





Message #5 by "Enzo Zaragoza" <enzaux@g...> on Mon, 17 Mar 2003 13:20:41 +0800
Kabayang George,
	
If you're using VB as front end you should make the text box field set MultiLine to True.
	
     Mid(txtMemo.Text, 1, InStr(1, txtMemo.Text, vbCrLf) - 1)


enzo c",)


-----Original Message-----
From: George Oro [mailto:george@c...]
Sent: Tuesday, March 04, 2003 12:49 PM
To: Access
Subject: [access] RE: Urgent: Count Line


Kabayang Enzo,

I tried but it doesn't work, can I see your idea maybe I missed something. 

TIA,
George


> -----Original Message-----
> From: Enzo Zaragoza [mailto:enzaux@g...]
> Sent: Monday, March 17, 2003 4:52 AM
> To: Access
> Subject: [access] RE: Urgent: Count Line
> 
> 
> 
> Kabayang George,
> 
> 	Make use of INSTR & MID
> 
> enzo c",)
> 
> -----Original Message-----
> From: George Oro [mailto:george@c...]
> Sent: Sunday, March 16, 2003 4:32 PM
> To: Access
> Subject: [access] Urgent: Count Line
> 
> 
> I have a field which the Enter Key Behavior is = New Line in Field and
> sometimes the data is copy & paste from a memo field. I want to have a code
> that should read only the first line of that Text Field.
> 
> For Instance:
> This is my first line
> This is my second line
> and this is my last line
> 
> I want my code to return only "This is my first line" and disregard the
> rest. Is there any way to accomplish this.
> 
> Any tips would be highly appreciated...
> 
> 
> TIA,
> George
> 
> 
> 
> 
> 
> 
> 
> 




Message #6 by "Enzo Zaragoza" <enzaux@g...> on Mon, 17 Mar 2003 13:24:35 +0800
	Or may be you can make use of SPLIT function:

 Dim arrTest() As String
   arrTest = Split(txtMemo.Text, vbCrLf)
   Msg arrTest(0) ' this holds the first line

enzo c",)

-----Original Message-----
From: George Oro [mailto:george@c...]
Sent: Tuesday, March 04, 2003 12:49 PM
To: Access
Subject: [access] RE: Urgent: Count Line


Kabayang Enzo,

I tried but it doesn't work, can I see your idea maybe I missed something. 

TIA,
George


> -----Original Message-----
> From: Enzo Zaragoza [mailto:enzaux@g...]
> Sent: Monday, March 17, 2003 4:52 AM
> To: Access
> Subject: [access] RE: Urgent: Count Line
> 
> 
> 
> Kabayang George,
> 
> 	Make use of INSTR & MID
> 
> enzo c",)
> 
> -----Original Message-----
> From: George Oro [mailto:george@c...]
> Sent: Sunday, March 16, 2003 4:32 PM
> To: Access
> Subject: [access] Urgent: Count Line
> 
> 
> I have a field which the Enter Key Behavior is = New Line in Field and
> sometimes the data is copy & paste from a memo field. I want to have a code
> that should read only the first line of that Text Field.
> 
> For Instance:
> This is my first line
> This is my second line
> and this is my last line
> 
> I want my code to return only "This is my first line" and disregard the
> rest. Is there any way to accomplish this.
> 
> Any tips would be highly appreciated...
> 
> 
> TIA,
> George
> 
> 
> 
> 
> 
> 
> 
> 




Message #7 by "George Oro" <george@c...> on Tue, 4 Mar 2003 10:19:29 +0400
You made my life 99% happy today John & Enzo!!!!

1% remaining, not all the case there's a second line, because the code giving an error "Invalid Procedure" if only one line. How can
I check something like this:

If Line > 1 then
	txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField, vbCrLf) - 1)
else
	txtFirstLine=trim(MyMemoField)
end if

Sorry if I didn't mentioned this earlier...

Many, many thanks again...

Cheers,
George


> -----Original Message-----
> From: John Ruff [mailto:papparuff@a...]
> Sent: Monday, March 17, 2003 9:06 AM
> To: Access
> Subject: [access] RE: Urgent: Count Line
>
>
> This should work George,
>
>     txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField, vbCrLf) - 1)
>
> John V. Ruff - The Eternal Optimist :-)
> Always Looking For Contract Opportunities
>
> www.noclassroom.com
> Live software training
> Right over the Internet
>
> Home:  xxx.xxx.xxxx
> Cell: 253.307/2947
> 9306 Farwest Dr SW
> Lakewood, WA 98498
>
> "Commit to the Lord whatever you do,
> 	and your plans will succeed." Proverbs 16:3
>
>
>
> -----Original Message-----
> From: George Oro [mailto:george@c...]
> Sent: Sunday, March 16, 2003 12:32 AM
> To: Access
> Subject: [access] Urgent: Count Line
>
>
> I have a field which the Enter Key Behavior is = New Line in Field and
> sometimes the data is copy & paste from a memo field. I want to have a code
> that should read only the first line of that Text Field.
>
> For Instance:
> This is my first line
> This is my second line
> and this is my last line
>
> I want my code to return only "This is my first line" and disregard the
> rest. Is there any way to accomplish this.
>
> Any tips would be highly appreciated...
>
>
> TIA,
> George
>
>
>
>
>
>
>

Message #8 by "Enzo Zaragoza" <enzaux@g...> on Mon, 17 Mar 2003 14:50:44 +0800
Kabayang George,

if InStr(1, MyMemoField, vbCrLf)=0 then
   FirstLineLen = 0
else
   FirstLineLen = InStr(1, MyMemoField, vbCrLf) -1
end if

txtFirstLine = Left(MyMemoField, FirstLineLen)


enzo c",)

-----Original Message-----
From: George Oro [mailto:george@c...]
Sent: Tuesday, March 04, 2003 2:19 PM
To: Access
Subject: [access] RE: Urgent: Count Line


You made my life 99% happy today John & Enzo!!!!

1% remaining, not all the case there's a second line, because the code giving an error "Invalid Procedure" if only one line. How
can
I check something like this:

If Line > 1 then
	txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField, vbCrLf) - 1)
else
	txtFirstLine=trim(MyMemoField)
end if

Sorry if I didn't mentioned this earlier...

Many, many thanks again...

Cheers,
George


> -----Original Message-----
> From: John Ruff [mailto:papparuff@a...]
> Sent: Monday, March 17, 2003 9:06 AM
> To: Access
> Subject: [access] RE: Urgent: Count Line
>
>
> This should work George,
>
>     txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField, vbCrLf) - 1)
>
> John V. Ruff - The Eternal Optimist :-)
> Always Looking For Contract Opportunities
>
> www.noclassroom.com
> Live software training
> Right over the Internet
>
> Home:  xxx.xxx.xxxx
> Cell: 253.307/2947
> 9306 Farwest Dr SW
> Lakewood, WA 98498
>
> "Commit to the Lord whatever you do,
> 	and your plans will succeed." Proverbs 16:3
>
>
>
> -----Original Message-----
> From: George Oro [mailto:george@c...]
> Sent: Sunday, March 16, 2003 12:32 AM
> To: Access
> Subject: [access] Urgent: Count Line
>
>
> I have a field which the Enter Key Behavior is = New Line in Field and
> sometimes the data is copy & paste from a memo field. I want to have a code
> that should read only the first line of that Text Field.
>
> For Instance:
> This is my first line
> This is my second line
> and this is my last line
>
> I want my code to return only "This is my first line" and disregard the
> rest. Is there any way to accomplish this.
>
> Any tips would be highly appreciated...
>
>
> TIA,
> George
>
>
>
>
>
>
>





Message #9 by "John Ruff" <papparuff@a...> on Sun, 16 Mar 2003 23:00:17 -0800
	if InStr(1, MyMemoField, vbCrLf)>0 then
		txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField,
vbCrLf) - 1) 
	else
		txtFirstLine = MyMemoField
	endif

John V. Ruff - The Eternal Optimist :-)
Always Looking For Contract Opportunities

www.noclassroom.com
Live software training
Right over the Internet

Home:  xxx.xxx.xxxx
Cell: 253.307/2947
9306 Farwest Dr SW
Lakewood, WA 98498

"Commit to the Lord whatever you do,
	and your plans will succeed." Proverbs 16:3



-----Original Message-----
From: George Oro [mailto:george@c...] 
Sent: Monday, March 03, 2003 10:19 PM
To: Access
Subject: [access] RE: Urgent: Count Line


You made my life 99% happy today John & Enzo!!!!

1% remaining, not all the case there's a second line, because the code
giving an error "Invalid Procedure" if only one line. How can I check
something like this:

If Line > 1 then
	txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField, vbCrLf) - 1)
else
	txtFirstLine=trim(MyMemoField)
end if

Sorry if I didn't mentioned this earlier...

Many, many thanks again...

Cheers,
George


> -----Original Message-----
> From: John Ruff [mailto:papparuff@a...]
> Sent: Monday, March 17, 2003 9:06 AM
> To: Access
> Subject: [access] RE: Urgent: Count Line
>
>
> This should work George,
>
>     txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField, vbCrLf) - 
> 1)
>
> John V. Ruff - The Eternal Optimist :-)
> Always Looking For Contract Opportunities
>
> www.noclassroom.com
> Live software training
> Right over the Internet
>
> Home:  xxx.xxx.xxxx
> Cell: 253.307/2947
> 9306 Farwest Dr SW
> Lakewood, WA 98498
>
> "Commit to the Lord whatever you do,
> 	and your plans will succeed." Proverbs 16:3
>
>
>
> -----Original Message-----
> From: George Oro [mailto:george@c...]
> Sent: Sunday, March 16, 2003 12:32 AM
> To: Access
> Subject: [access] Urgent: Count Line
>
>
> I have a field which the Enter Key Behavior is = New Line in Field and 
> sometimes the data is copy & paste from a memo field. I want to have a 
> code that should read only the first line of that Text Field.
>
> For Instance:
> This is my first line
> This is my second line
> and this is my last line
>
> I want my code to return only "This is my first line" and disregard 
> the rest. Is there any way to accomplish this.
>
> Any tips would be highly appreciated...
>
>
> TIA,
> George
>
>
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or to 
> unsubscribe send a blank email to 
>
>
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or to 
> unsubscribe send a blank email to 
>




Message #10 by "Enzo Zaragoza" <enzaux@g...> on Mon, 17 Mar 2003 15:18:15 +0800
John has always the optimized code!! :p

enzo c",)

-----Original Message-----
From: John Ruff [mailto:papparuff@a...]
Sent: Monday, March 17, 2003 3:00 PM
To: Access
Subject: [access] RE: Urgent: Count Line


	if InStr(1, MyMemoField, vbCrLf)>0 then
		txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField,
vbCrLf) - 1) 
	else
		txtFirstLine = MyMemoField
	endif

John V. Ruff - The Eternal Optimist :-)
Always Looking For Contract Opportunities

www.noclassroom.com
Live software training
Right over the Internet

Home:  xxx.xxx.xxxx
Cell: 253.307/2947
9306 Farwest Dr SW
Lakewood, WA 98498

"Commit to the Lord whatever you do,
	and your plans will succeed." Proverbs 16:3



-----Original Message-----
From: George Oro [mailto:george@c...] 
Sent: Monday, March 03, 2003 10:19 PM
To: Access
Subject: [access] RE: Urgent: Count Line


You made my life 99% happy today John & Enzo!!!!

1% remaining, not all the case there's a second line, because the code
giving an error "Invalid Procedure" if only one line. How can I check
something like this:

If Line > 1 then
	txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField, vbCrLf) - 1)
else
	txtFirstLine=trim(MyMemoField)
end if

Sorry if I didn't mentioned this earlier...

Many, many thanks again...

Cheers,
George


> -----Original Message-----
> From: John Ruff [mailto:papparuff@a...]
> Sent: Monday, March 17, 2003 9:06 AM
> To: Access
> Subject: [access] RE: Urgent: Count Line
>
>
> This should work George,
>
>     txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField, vbCrLf) - 
> 1)
>
> John V. Ruff - The Eternal Optimist :-)
> Always Looking For Contract Opportunities
>
> www.noclassroom.com
> Live software training
> Right over the Internet
>
> Home:  xxx.xxx.xxxx
> Cell: 253.307/2947
> 9306 Farwest Dr SW
> Lakewood, WA 98498
>
> "Commit to the Lord whatever you do,
> 	and your plans will succeed." Proverbs 16:3
>
>
>
> -----Original Message-----
> From: George Oro [mailto:george@c...]
> Sent: Sunday, March 16, 2003 12:32 AM
> To: Access
> Subject: [access] Urgent: Count Line
>
>
> I have a field which the Enter Key Behavior is = New Line in Field and 
> sometimes the data is copy & paste from a memo field. I want to have a 
> code that should read only the first line of that Text Field.
>
> For Instance:
> This is my first line
> This is my second line
> and this is my last line
>
> I want my code to return only "This is my first line" and disregard 
> the rest. Is there any way to accomplish this.
>
> Any tips would be highly appreciated...
>
>
> TIA,
> George
>
>
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or to 
> unsubscribe send a blank email to 
>
>
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp or to 
> unsubscribe send a blank email to 
>








Message #11 by "George Oro" <george@c...> on Tue, 4 Mar 2003 12:02:50 +0400
"John has always the optimized code!!" Very true... 

It's working!! now I'm 101% happy today...

Thanks again John & also to you Kabayang Enzo!!!

Cheers,
George ;)


> -----Original Message-----
> From: Enzo Zaragoza [mailto:enzaux@g...]
> Sent: Monday, March 17, 2003 11:18 AM
> To: Access
> Subject: [access] RE: Urgent: Count Line
> 
> 
> 
> John has always the optimized code!! :p
> 
> enzo c",)
> 
> -----Original Message-----
> From: John Ruff [mailto:papparuff@a...]
> Sent: Monday, March 17, 2003 3:00 PM
> To: Access
> Subject: [access] RE: Urgent: Count Line
> 
> 
> 	if InStr(1, MyMemoField, vbCrLf)>0 then
> 		txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField,
> vbCrLf) - 1) 
> 	else
> 		txtFirstLine = MyMemoField
> 	endif
> 
> John V. Ruff - The Eternal Optimist :-)
> Always Looking For Contract Opportunities
> 
> www.noclassroom.com
> Live software training
> Right over the Internet
> 
> Home:  xxx.xxx.xxxx
> Cell: 253.307/2947
> 9306 Farwest Dr SW
> Lakewood, WA 98498
> 
> "Commit to the Lord whatever you do,
> 	and your plans will succeed." Proverbs 16:3
> 
> 
> 
> -----Original Message-----
> From: George Oro [mailto:george@c...] 
> Sent: Monday, March 03, 2003 10:19 PM
> To: Access
> Subject: [access] RE: Urgent: Count Line
> 
> 
> You made my life 99% happy today John & Enzo!!!!
> 
> 1% remaining, not all the case there's a second line, because the code
> giving an error "Invalid Procedure" if only one line. How can I check
> something like this:
> 
> If Line > 1 then
> 	txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField, vbCrLf) - 1)
> else
> 	txtFirstLine=trim(MyMemoField)
> end if
> 
> Sorry if I didn't mentioned this earlier...
> 
> Many, many thanks again...
> 
> Cheers,
> George
> 
> 
> > -----Original Message-----
> > From: John Ruff [mailto:papparuff@a...]
> > Sent: Monday, March 17, 2003 9:06 AM
> > To: Access
> > Subject: [access] RE: Urgent: Count Line
> >
> >
> > This should work George,
> >
> >     txtFirstLine = Left(MyMemoField, InStr(1, MyMemoField, vbCrLf) - 
> > 1)
> >
> > John V. Ruff - The Eternal Optimist :-)
> > Always Looking For Contract Opportunities
> >
> > www.noclassroom.com
> > Live software training
> > Right over the Internet
> >
> > Home:  xxx.xxx.xxxx
> > Cell: 253.307/2947
> > 9306 Farwest Dr SW
> > Lakewood, WA 98498
> >
> > "Commit to the Lord whatever you do,
> > 	and your plans will succeed." Proverbs 16:3
> >
> >
> >
> > -----Original Message-----
> > From: George Oro [mailto:george@c...]
> > Sent: Sunday, March 16, 2003 12:32 AM
> > To: Access
> > Subject: [access] Urgent: Count Line
> >
> >
> > I have a field which the Enter Key Behavior is = New Line in Field and 
> > sometimes the data is copy & paste from a memo field. I want to have a 
> > code that should read only the first line of that Text Field.
> >
> > For Instance:
> > This is my first line
> > This is my second line
> > and this is my last line
> >
> > I want my code to return only "This is my first line" and disregard 
> > the rest. Is there any way to accomplish this.
> >
> > Any tips would be highly appreciated...
> >
> >
> > TIA,
> > George
> >
> >
> >
> > ---
> > Change your mail options at http://p2p.wrox.com/manager.asp or to 
> > unsubscribe send a blank email to 
> >
> >
> >
> > ---
> > Change your mail options at http://p2p.wrox.com/manager.asp or to 
> > unsubscribe send a blank email to 
> >
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

  Return to Index