Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I check for a valid local address to save a file?

Posted on 2011-02-21
10
Medium Priority
?
301 Views
Last Modified: 2012-05-11
I have a form that has a field with a http address and a field with a folder location. The command button when clicked downloads the file to the local folder. If the folder location is null it ask to browse to a location to save it. If the folder location has an address it saves it there. The problem is what if the folder location is in valid? i have attached file.  FileCopySave.mdb
0
Comment
Question by:seanlhall
  • 5
  • 4
10 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34943413
what is your basis for valid folder location?
0
 

Author Comment

by:seanlhall
ID: 34943614
For exaample if in the folder location it has a location that is not on that computer it will say it is save there even though it does not exsist. I would like the browse for folder to come up if the location is not correct.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34943648


if dir(me.txtFolderLocation,vbdirectory)="" then
   msgbox "Folder does not exists"
   exit sub
   else

    'save file here
end if
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 44

Expert Comment

by:GRayL
ID: 34943801
How can your BrowseFolder function find a location that is not valid?  
0
 

Author Comment

by:seanlhall
ID: 34943862
runtime error 52 bad file or number. This happens when folderlocation is null, has valid address or not.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 34943879
seanlhall,
did you try the codes  i posted above?
0
 

Author Comment

by:seanlhall
ID: 34943880
The folder location is where it is saved. If the location entered in the folder location is not valid for some reason, it will said it has saved the file there but it is not because the location is not valid.
0
 

Author Comment

by:seanlhall
ID: 34943890
yes that is the error i get.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 34943910
try this

if dir(me.txtFolderLocation & "",vbdirectory)="" then
   msgbox "Folder does not exists"
   exit sub
   else

    'save file here
end if
0
 

Author Closing Comment

by:seanlhall
ID: 34944034
That was what I was looking for, thanks.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question