Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: creating a directory conditions (if exist and not exist) VBA


Message #1 by "Elmer Espinosa" <elmerespinosa@y...> on Fri, 11 May 2001 23:02:17 +0800
Below is the code I made but still it doesn't work.  Please advise.  And

what does the dir$ do?



Private Sub Command68_Click()

Dim Mydir As String

Dim direc As String

Dim a As String

Dim Temp

direc =3D Me.Directory.Value

a =3D Me.[Request#].Value

direc =3D Text1



    If Len(Dir(direc & "\.", vbDirectory)) > 0 Then

        MkDir Text1

        Open direc & a & ".txt" For Output As #1

            Print #1, " elmer"

    Else

        'Len(Dir$("\.", vbDirectory)) > 0 Then

        'MkDir Text1

        Open direc & a & ".txt" For Output As #1

            Print #1, " elmer"

        Close #1

    End If

End Sub


  Return to Index