<?xml version="1.0" encoding="iso-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Dansk Access Forum : FileExists</title>
  <link>https://www.accessforum.dk/</link>
  <description><![CDATA[Dette er et XML Feed af; Dansk Access Forum : VBA / Makro : FileExists]]></description>
  <pubDate>Sat, 05 Dec 2026 03:15:34 +0000</pubDate>
  <lastBuildDate>Wed, 04 May 2016 12:02:39 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.08</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://www.accessforum.dk/RSS_post_feed.asp?TID=83</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Dansk Access Forum]]></title>
   <url>https://www.accessforum.dk/css_styles/accessforum.dk/logo.png</url>
   <link>https://www.accessforum.dk/</link>
  </image>
  <item>
   <title><![CDATA[FileExists : Hvis ikke ovenst&#229;ende er hvad...]]></title>
   <link>https://www.accessforum.dk/fileexists_topic83_post328.html#328</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://www.accessforum.dk/member_profile.asp?PF=7">hkh</a><br /><strong>Emne:</strong> 83<br /><strong>Sendt:</strong> 04-Maj-2016 kl. 12:02<br /><br />Hvis ikke ovenstående er hvad du søger, eller du behøver yderligere hjælp så prøver du bare igen.]]>
   </description>
   <pubDate>Wed, 04 May 2016 12:02:39 +0000</pubDate>
   <guid isPermaLink="true">https://www.accessforum.dk/fileexists_topic83_post328.html#328</guid>
  </item> 
  <item>
   <title><![CDATA[FileExists : Hvis det skal v&#230;re din knap der...]]></title>
   <link>https://www.accessforum.dk/fileexists_topic83_post327.html#327</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://www.accessforum.dk/member_profile.asp?PF=7">hkh</a><br /><strong>Emne:</strong> 83<br /><strong>Sendt:</strong> 04-Maj-2016 kl. 11:34<br /><br />Hvis det skal være din knap der udløser undersøgelsen om filen eksisterer kan det gøres med en hændelsesprocedure på knappen.<br /><br />Det er blot at kalde FileExists med indholdet af variabel_sti i en IF Then Else sætning<br /><br />Private Sub Kommandoknap0_Click()<br />&nbsp;&nbsp;&nbsp;&nbsp;If FileExists(variabel_sti) = True Then<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msgbox"Filen: " & variabel_sti & " findes!"<br />&nbsp;&nbsp;&nbsp;&nbsp;Else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msgbox"Filen: " & variabel_sti & " findes ikke!"<br />&nbsp;&nbsp;&nbsp;&nbsp;End If<br />End Sub<br /><br />]]>
   </description>
   <pubDate>Wed, 04 May 2016 11:34:59 +0000</pubDate>
   <guid isPermaLink="true">https://www.accessforum.dk/fileexists_topic83_post327.html#327</guid>
  </item> 
  <item>
   <title><![CDATA[FileExists :  Hej igen,jeg har oprettet et...]]></title>
   <link>https://www.accessforum.dk/fileexists_topic83_post326.html#326</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://www.accessforum.dk/member_profile.asp?PF=156">frederik</a><br /><strong>Emne:</strong> 83<br /><strong>Sendt:</strong> 04-Maj-2016 kl. 11:21<br /><br />Hej igen,<div>&nbsp;</div><div>jeg har oprettet et eksempel her, så er det lidt lettere at forklare:</div><div>&nbsp;</div><div><a href="https://dl.dropboxuserc&#111;ntent.com/u/51624320/FileExists.accdb" target="_blank" rel="nofollow">https://dl.dropboxusercontent.com/u/51624320/FileExists.accdb</a></div><div>&nbsp;</div><div>Det jeg gerne vil er, at udskifte stien her: FileExists('F:\acad\ARKE\E54\000-199\354E024B.dwg')</div><div>&nbsp;</div><div>med en sti som ligger i samme formular hvor funktionen kaldes, og som er variabel...(beregnes ud fra andre felter på formularen)</div><div>&nbsp;</div><div>fx: FileExists('&#091;variabel_sti&#093;')</div><div>&nbsp;</div><div>Håber det letter forståelsen af problemet....</div><div>&nbsp;</div><div>/Frederik</div>]]>
   </description>
   <pubDate>Wed, 04 May 2016 11:21:21 +0000</pubDate>
   <guid isPermaLink="true">https://www.accessforum.dk/fileexists_topic83_post326.html#326</guid>
  </item> 
  <item>
   <title><![CDATA[FileExists : &amp;#034;Men hvordan kan jeg lave...]]></title>
   <link>https://www.accessforum.dk/fileexists_topic83_post325.html#325</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://www.accessforum.dk/member_profile.asp?PF=7">hkh</a><br /><strong>Emne:</strong> 83<br /><strong>Sendt:</strong> 04-Maj-2016 kl. 11:04<br /><br />"<font color="blue">Men hvordan kan jeg lave den sti variabel…. Vil gerne kunne referere til en sti på formularen</font>"<br /><br />Hvad mener du med det?<br />Hvilken formular?<br /><br />Du kommer til at forklare hvad du ønsker og hvad problemet er, ellers er det ikke nemt at komme med vejledning.]]>
   </description>
   <pubDate>Wed, 04 May 2016 11:04:39 +0000</pubDate>
   <guid isPermaLink="true">https://www.accessforum.dk/fileexists_topic83_post325.html#325</guid>
  </item> 
  <item>
   <title><![CDATA[FileExists :    Hej,    Jeg har l&#229;nt...]]></title>
   <link>https://www.accessforum.dk/fileexists_topic83_post324.html#324</link>
   <description>
    <![CDATA[<strong>Forfatter:</strong> <a href="https://www.accessforum.dk/member_profile.asp?PF=156">frederik</a><br /><strong>Emne:</strong> 83<br /><strong>Sendt:</strong> 04-Maj-2016 kl. 10:41<br /><br /><font face="Times New Roman" size="3"></font><p ="Ms&#111;normal" style="margin: 0cm 0cm 0pt;"><font size="3"><font face="Calibri">Hej,<o:p></o:p></font></font></p><font face="Times New Roman" size="3"></font><p ="Ms&#111;normal" style="margin: 0cm 0cm 0pt;"><o:p><font face="Calibri" size="3">&nbsp;</font></o:p></p><font face="Times New Roman" size="3"></font><p ="Ms&#111;normal" style="margin: 0cm 0cm 0pt;"><font size="3"><font face="Calibri">Jeg har lånt noget kode (VB) på nettet der tjekker om enfil findes på en given sti…<o:p></o:p></font></font></p><font face="Times New Roman" size="3"></font><p ="Ms&#111;normal" style="margin: 0cm 0cm 0pt;"><o:p><font face="Calibri" size="3">&nbsp;</font></o:p></p><font face="Times New Roman" size="3"></font><p ="Ms&#111;normal" style="margin: 0cm 0cm 0pt;"><font size="3"><font face="Calibri">FileExists('F:\acad\ARKE\E54\000-199\354E024B.dwg') –funktionen returner sand hvis den findes.</font></font></p><font size="3"><font face="Calibri"><p ="Ms&#111;normal" style="margin: 0cm 0cm 0pt;">&nbsp;</p><p ="Ms&#111;normal" style="margin: 0cm 0cm 0pt;">Men hvordan kan jeg lave den sti variabel…. Vil gerne kunnereferere til en sti på formularen… …, og så lade funktionen tjekke om den er gyldig....</p><div></div><div>/Frederik</div><div>-------------------------------------</div><div>Function FileExists(ByVal strFile As String, Optional bFindFolders As Boolean) As Boolean<br><span ="CodeComment">    'Purpose:   Return True if the file exists, even if it is hidden.    'Arguments: strFile: File name to look for. Current directory searched if no path included.    '           bFindFolders. If strFile is a folder, FileExists() returns False unless this argument is True.    'Note:      Does not look inside subdirectories for the file.    'Author:    Allen Browne. http://allenbrowne.com June, 2006.</span><br>&nbsp;&nbsp;&nbsp; Dim lngAttributes As Long<br><br><span ="CodeComment">    'Include read-only files, hidden files, system files.</span><br>&nbsp;&nbsp;&nbsp; lngAttributes = (vbReadOnly Or vbHidden Or vbSystem)<br><br>&nbsp;&nbsp;&nbsp; If bFindFolders Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lngAttributes = (lngAttributes Or vbDirectory) <span ="CodeComment">'Include folders as well.</span><br>&nbsp;&nbsp;&nbsp; Else<br><span ="CodeComment">        'Strip any trailing slash, so Dir does not look inside the folder.</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Do While Right$(strFile, 1) = "\"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strFile = Left$(strFile, Len(strFile) - 1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Loop<br>&nbsp;&nbsp;&nbsp; End If<br><br><span ="CodeComment">    'If Dir() returns something, the file exists.</span><br>&nbsp;&nbsp;&nbsp; On Error Resume Next<br>&nbsp;&nbsp;&nbsp; FileExists = (Len(Dir(strFile, lngAttributes)) &gt; 0)<br>End Function<br><br>Function FolderExists(strPath As String) As Boolean<br>&nbsp;&nbsp;&nbsp; On Error Resume Next<br>&nbsp;&nbsp;&nbsp; FolderExists = ((GetAttr(strPath) And vbDirectory) = vbDirectory)<br>End Function<br><br>Function TrailingSlash(varIn As Variant) As String<br>&nbsp;&nbsp;&nbsp; If Len(varIn) &gt; 0 Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If Right(varIn, 1) = "\" Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TrailingSlash = varIn<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TrailingSlash = varIn &amp; "\"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<br>&nbsp;&nbsp;&nbsp; End If<br>End Function</div><p ="Ms&#111;normal" style="margin: 0cm 0cm 0pt;"><o:p></o:p>&nbsp;</p><p ="Ms&#111;normal" style="margin: 0cm 0cm 0pt;"><o:p></o:p>&nbsp;</p></font><p ="Ms&#111;normal" style="margin: 0cm 0cm 0pt;"></p></font><p ="Ms&#111;normal" style="margin: 0cm 0cm 0pt;"></p><font face="Times New Roman" size="3"></font>]]>
   </description>
   <pubDate>Wed, 04 May 2016 10:41:06 +0000</pubDate>
   <guid isPermaLink="true">https://www.accessforum.dk/fileexists_topic83_post324.html#324</guid>
  </item> 
 </channel>
</rss>