Results 1 to 7 of 7

Thread: [RESOLVED] command button to save your textboxs value

  1. #1

    Thread Starter
    Lively Member milen's Avatar
    Join Date
    May 2006
    Posts
    116

    Resolved [RESOLVED] command button to save your textboxs value

    hii everybody
    i want ask you about my form that contain 3 textboxs with one command button so i want to make this commandbutton to save what is in the textbox as *txt files for next use
    please help and give me if it 's possible the function or code ,okey!
    --------------------
    your brother milen thx a lot guys
    regard's
    Last edited by Hack; Jun 8th, 2006 at 06:57 AM. Reason: Added RESOLVED to thread title and green resolve checkmark

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: command button to save your textboxs value

    Have you researched on the Open statement, Print statement, and Input statement?

  3. #3

    Thread Starter
    Lively Member milen's Avatar
    Join Date
    May 2006
    Posts
    116

    Re: command button to save your textboxs value

    what means open statment where can i fond him??????

  4. #4
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: command button to save your textboxs value

    Check out this link:

    Write text to a Text File
    CS

  5. #5
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: command button to save your textboxs value

    here is more specifically what u need

    this is assuming the textboxes have 1 line in each.. if multiline then let me know
    you could do that a few different ways
    VB Code:
    1. Private Sub Command1_Click()
    2.     Open App.Path & "\data.txt" For Output As #1
    3.         Print #1, Text1
    4.         Print #1, Text2
    5.         Print #1, Text3
    6.     Close #1
    7. End Sub
    8.  
    9. Private Sub Form_Load()
    10.     Dim tmp As String
    11.     If Len(Dir(App.Path & "\data.txt")) <> 0 Then
    12.         Open App.Path & "\data.txt" For Input As #1
    13.             Line Input #1, tmp
    14.             Text1 = tmp
    15.             Line Input #1, tmp
    16.             Text2 = tmp
    17.             Line Input #1, tmp
    18.             Text3 = tmp
    19.         Close #1
    20.     End If
    21. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  6. #6

    Thread Starter
    Lively Member milen's Avatar
    Join Date
    May 2006
    Posts
    116

    Re: command button to save your textboxs value

    theank you guys it's work
    spicilly static thx a lot
    milen
    regard's

  7. #7
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: command button to save your textboxs value

    When you have received an answer to your question, please mark it as Resolved using the Thread Tools menu.
    CS

Posting Permissions

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



Click Here to Expand Forum to Full Width