Folders...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lee123
    Contributor
    • Feb 2007
    • 556

    Folders...

    how do i create a folder once i have a program i have been trying to figure out a way to do this so it doesn't keep trying to create it every time i open up the program here is my code

    Code:
    Private Sub Form_Load()
        Dim fso As New FileSystemObject, fldr As Folder
        Set fldr = fso.CreateFolder("C:\Program Files\My Bill Backup Files")
    End Sub
    so everytime i click on this button it dosen't say "File Already Exist"

    Code:
    Private Sub ProcessBtn_Click()
    Dim Answer As Integer
    Dim ff As String
    ff = FreeFile
    Me.Refresh
       Open "C:\Program Files\My Bill Backup Files\BillFileSaverBackup.log" For Append As #ff
            Print #ff, "Bill Saver Backup Log" & " " & vbNewLine
            Print #ff, "Date Filed:" & "          " & Date
            Print #ff, "Bill Name:" & "           " & BillName
            Print #ff, "Date Paid:" & "           " & DatePaid
            Print #ff, "Amount Paid:" & "         " & AmountPaid
            Print #ff, "Reference Number:" & "    " & ReferenceNumber
            Print #ff, "-------------------------------------------------"
          Close #ff
        Answer = MsgBox("Do You Wish To Put Anymore Bills In The Filing Cabinet?", vbYesNo + vbQuestion, "Whats Ur Response...?")
        If Answer = vbYes Then Adodc1.Recordset.AddNew
        Adodc1.Recordset.MoveNext
        If Answer = vbNo Then Exit Sub
        If ProcessBtn Then
            Label5.Caption = "Thank You!"
            Picture1.Visible = False
            Picture2.Visible = True
        End If
    End Sub
    any input would be useful to me at this point..thanks in an advanced

    lee123
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    Code:
    If Dir("C:\", vbDirectory) <> "" Then
      'exists
    Else
      'does not exist
    End If


    Good Luck

    Comment

    Working...