'add this function and use this new command1 event
'it cuts down on wated code...
Public Function DirExists(ByVal sDirName As String) As Boolean
Dim sDir As String
On Error Resume Next
DirExists = False
sDir = Dir$(sDirName, vbDirectory)
If (Len(sDir) > 0) And (Err = 0) Then
DirExists = True
End If
End Function
Private Sub Command1_Click()
'SetFormPosition Form1.hWnd, vbTopMost
'if it's not there create it
If DirExists("C:\diva password\") = False Then
MkDir ("C:\diva password")
End If
Open sfile For Output As #1
Write #1, txtfn.Text, txtln.Text, txtcp.Text
Close #1
Command1.Enabled = False
txtfn.Text = ""
txtln.Text = ""
txtcp.Text = ""
End Sub




Reply With Quote