A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Setting Import Path



 
 
Thread Tools Display Modes
  #21  
Old July 5th, 2008, 03:51 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 12
Default Setting Import Path

Thanks - so what would you suggest as a function to check if the files
are present?

u12102@uwe wrote:

OK, that males sense but I would make it two separate functions. One that
verifies and sets the Path and another function that checks to see if all of
the files are present. The messages to the user and the solutions are
different for the two function.


  #22  
Old July 5th, 2008, 05:43 PM posted to microsoft.public.access.forms
ruralguy via AccessMonster.com
external usenet poster
 
Posts: 1,172
Default Setting Import Path

Something like this should do it:

Public Function CheckFiles(MyPath As String) As Boolean

CheckFiles = True '--Default to all files present
'-- Any file missing will leave CheckFiles as False
CheckFiles = CheckFiles And (Dir(MyPath & "\File1.csv") "")
CheckFiles = CheckFiles And (Dir(MyPath & "\File2.csv") "")
CheckFiles = CheckFiles And (Dir(MyPath & "\File3.csv") "")
CheckFiles = CheckFiles And (Dir(MyPath & "\File4.csv") "")
CheckFiles = CheckFiles And (Dir(MyPath & "\File5.csv") "")
CheckFiles = CheckFiles And (Dir(MyPath & "\File6.csv") "")

End Function

Called with:
If Not CheckFiles(MyPath) Then
MsgBox "All of the input files are not present"
End If

You can make if more robust and tell the user which file(s) are missing if
you want but you should probably check again just before importing to make
sure nothing has changed.

wrote:
Thanks - so what would you suggest as a function to check if the files
are present?

u12102@uwe wrote:

OK, that males sense but I would make it two separate functions. One that
verifies and sets the Path and another function that checks to see if all of
the files are present. The messages to the user and the solutions are
different for the two function.


--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200807/1

  #23  
Old July 5th, 2008, 07:02 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 12
Default Setting Import Path

That looks like it will do what I want - and I *think* that's the last
thing I wanted to know how to do with this particular database!

Thanks yet again for all your help over the last few days. I've
certainly learnt a few things. Just hope I can remember them if I
need them again

Chris.

u12102@uwe wrote:

Something like this should do it:


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:50 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.