save info from textbox

Posted on 2006-04-25
Last Modified: 2010-08-05
I have 2 textbox, email and password,
I have two buttons save and cancel.
how can I make something so that when I click
on save it makes a .txt file with the info;password
Question by:aplelois
    LVL 44

    Accepted Solution

    Hi aplelois,

    Private Sub Command1_Click()
        Dim lngFHandle as long
        lngFHandle = FreeFile()
        Open "MyOutputfile.txt" For Append As #lngFHandle
        Print #lngFHandle,txtEmail.Text & ";" & txtPassword.Text
        Close #lngFHandle
    End Sub

    Will do that.

    Tim Cottee
    LVL 26

    Assisted Solution

    Private Sub cmdSave_Click()

    Dim FileNo As Integer
    On Error Resume Next
    FileNo = FreeFile
    Open "yourfullpathfilename" For Append Shared As #FileNo
    Print #FileNo, text1.text & ";" & text2.text
    Close #FileNo

    End Sub
    LVL 26

    Expert Comment

    hehe doesn't refresh

    Author Comment

    both codes worked nicely, thanks a lot!

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now