Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

save info from textbox

hello,
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
email@domain.com;password
0
aplelois
Asked:
aplelois
  • 2
2 Solutions
 
TimCotteeCommented:
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
0
 
EDDYKTCommented:
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
0
 
EDDYKTCommented:
hehe doesn't refresh
0
 
apleloisAuthor Commented:
both codes worked nicely, thanks a lot!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now