Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a Save Button

Status
Not open for further replies.

Winky

Technical User
Aug 25, 2002
2
0
0
US
I need to create a button that allows the user to save the information they have just enetered does any1 no the code
 
here's what i used:
======================
Private Sub Command3_Click()
Dim mFileSysObj As New FileSystemObject
Dim mFile As File
Dim mTxtStream As TextStream

If mFileSysObj.FileExists("c:\clients.dat") = False Then
Call mFileSysObj.CreateTextFile("c:\clients.dat") 'create new clients.dat
Set mFile = mFileSysObj.GetFile("c:\clients.dat")
Set mTxtStream = mFile.OpenAsTextStream(ForAppending)
Call mTxtStream.WriteLine("whatever you want to write")
Call mTxtStream.Close
Else
Set mFile = mFileSysObj.GetFile("c:\clients.dat")
Set mTxtStream = mFile.OpenAsTextStream(ForAppending)
Label4.Caption = mFile.Path
Call mTxtStream.WriteLine(strBanner) 'writes to file
Call mTxtStream.Close
End If
End Sub
==================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top