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. |
|
|
Thread Tools | Display Modes |
#21
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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: |
#24
|
|||
|
|||
Setting Import Path
You're certainly welcome. We'll be around if you need any assistance in the
future. wrote: 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: -- 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 |
Thread Tools | |
Display Modes | |
|
|