i am trying to save my text boxes data to a new file through command button,but text boxes data is saved in the same file it saved last this is my code
Public Sub SaveTextBoxData(ByVal formSource As Form, ByVal fileName As String)
‘This will save all data currently in ant text boxes on the specified form
Dim counter As Control ‘used to cycle through the controls on a form
Dim fileNum As Integer ‘holds a handle to the file
‘open the file for writing
fileNum = FreeFile
Open fileName For Output As #fileNum
‘cycle through the controls on the form
For Each counter In formSource.Controls
‘is this control a text box
If TypeOf counter Is TextBox Then
‘save its Text property
Print #fileNum, counter.Name + “=” + counter.Text
End If
Next counter
Close #fileNum
End Sub
Private Sub savemnu_Click()
CommonDialog1.ShowSave
Call SaveTextBoxData(Me, App.Path + “.txt”)
End Sub
so please help me so that each time when i click save a common dialog box should appear and i can save the forms content to a new file..