May 6, 2003 #1 remco5897 Technical User Oct 27, 2001 48 NL Hi, Does anybody know how I can check whether a specific directory excists. For example, c:\documents\client1 thanks
Hi, Does anybody know how I can check whether a specific directory excists. For example, c:\documents\client1 thanks
May 6, 2003 #2 SgtJarrow Programmer Apr 12, 2002 2,937 US Look at the following: It checks for the directory and creates it if it doesn't exist. Dim strPath As String strPath = "G:\NewYorkBilling\Clearstream\" & CStr(Format(Forms![frmMain]![cboMonth], "yyyy") If Dir(strPath, vbDirectory) = "" Then MkDir (strPath) End If **************************** Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein) Robert L. Johnson III MCSA, CNA, MCP, Network+, A+ w: robert.l.johnson.iii@citigroup.com h: wildmage@tampabay.rr.com Upvote 0 Downvote
Look at the following: It checks for the directory and creates it if it doesn't exist. Dim strPath As String strPath = "G:\NewYorkBilling\Clearstream\" & CStr(Format(Forms![frmMain]![cboMonth], "yyyy") If Dir(strPath, vbDirectory) = "" Then MkDir (strPath) End If **************************** Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein) Robert L. Johnson III MCSA, CNA, MCP, Network+, A+ w: robert.l.johnson.iii@citigroup.com h: wildmage@tampabay.rr.com
May 6, 2003 Thread starter #3 remco5897 Technical User Oct 27, 2001 48 NL Thanks Robert, this exactly what I was looking for. Stupid of me because your solution is so simple. Kindest regards, Remco Upvote 0 Downvote
Thanks Robert, this exactly what I was looking for. Stupid of me because your solution is so simple. Kindest regards, Remco