MS Access - Remove Enter Key from the data


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: MS Access - Remove Enter Key from the data

  1. #1
    SiaoWei Guest

    MS Access - Remove Enter Key from the data


    Hi,

    Can anyone help me with the following problem?

    I'm having trouble removing the Enter key (13 hex) in my data record.
    Ex : I have a memo type field and the user will enter all the information
    into this field with the Enter key(sometime) as below.
    line 1
    line 2
    line 3
    But I need to get the output in my file as line 1 line 2 line 3.
    Mean without the Enter key, so my data won't go to the next line.

    As I know, in MS Excel we can use the CLEAN command, but this function is
    fail on MS Access.

    If anyone has a solution, please email me to swong@pcsmy.com.my
    Any help greatly appreciated.

    Thanks again.
    SiaoWei


  2. #2
    Larry Goldstein Guest

    Re: MS Access - Remove Enter Key from the data

    Using the Instr function, parse the data and replace CHR$(13) with a blank.

    Do
    lStart = lStart + 1
    if lStart < len(strX) then
    lFound = instr(1,strX,chr$(13))
    if lFound > 0 then
    strX = Left$(strX,lFound-1) & " " & right$(strX,Len(strX -
    lFound))
    end if
    end if
    Loop until lStart = len(strX) or lFound < 1

    Good luck!

    Larry Goldstein
    Advanswers


    "SiaoWei" <swong@pcsmy.com.my> wrote in message
    news:3b32b44f$1@news.devx.com...
    >
    > Hi,
    >
    > Can anyone help me with the following problem?
    >
    > I'm having trouble removing the Enter key (13 hex) in my data record.
    > Ex : I have a memo type field and the user will enter all the information
    > into this field with the Enter key(sometime) as below.
    > line 1
    > line 2
    > line 3
    > But I need to get the output in my file as line 1 line 2 line 3.
    > Mean without the Enter key, so my data won't go to the next line.
    >
    > As I know, in MS Excel we can use the CLEAN command, but this function is
    > fail on MS Access.
    >
    > If anyone has a solution, please email me to swong@pcsmy.com.my
    > Any help greatly appreciated.
    >
    > Thanks again.
    > SiaoWei
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center