Results 1 to 3 of 3

Thread: Why does this add the text to a new line in the textbox?

  1. #1
    Fanatic Member
    Join Date
    May 09
    Posts
    868

    Why does this add the text to a new line in the textbox?

    Hi guys, I have a text box and for some reason when I run this code

    Text2.Text = Text2.Text + field.Text & "'" & " " & statement.Text & " " & "'" & value.Text & "'"

    when a command button is clicked it's adding field.Text & "'" & " " & statement.Text & " " & "'" & value.Text & "'" to a new line as apose to the same line.

    any ideas why ?

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 02
    Posts
    21,636

    Re: Why does this add the text to a new line in the textbox?

    It should only do that if Text2 already included a crlf...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.-I also subscribe to all threads I participate, so there's no need to pm when there's an update.*
    *Proof positive that searching the forums does work: View Thread *
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *
    * Use Offensive Programming, not Defensive Programming. * On Error Resume Next is error ignoring, not error handling(tm).
    "There is a major problem with your code, and VB wants to tell you what it is.. but you have decided to put your fingers in your ears and shout 'I'm not listening!'" - si_the_geek on using OERN

  3. #3
    PowerPoster
    Join Date
    Jul 06
    Location
    Maldon, Essex. UK
    Posts
    5,129

    Re: Why does this add the text to a new line in the textbox?

    ....... or field.Text starts with a crlf
    ........or value.Text ends with a crlf (if Text2.Text starts of as null)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •