473,383 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Create a directory form access?

I'm sure this is possible with VBA, but I don't know how where to start. I'm mildly familiar with VBA, but not near fluent.

I'm trying to improve a database that I use daily for work. I store client records on an external hard drive. I already created a dynamic hyperlink for the folder that is essentially: C:\.....\[file_as]

that link works fine if the folder exists, but if it doesn't exist it returns an error. I want to be able to create the directory from here.

For instance when I click "Client Documents" rather than the error message coming up, I'd like it to say "this folder does not exist, would you like to create it?"

Any help is appreciated.
Thank you!!
Nov 19 '12 #1
3 2009
Rabbit
12,516 Expert Mod 8TB
The MkDir() function can create a directory.
Nov 19 '12 #2
zmbd
5,501 Expert Mod 4TB
The MkDir will work Rabbit as stated; however, this doesn't sound like what you're after in the long run. In fact, at this point it doesn't even sound like a VBA issue and more along the lines of an OS situation.

Where is the hyperlink located: in a shortcut on the desktop; as a link in a data table?

And what EXACTLY is the error message that is showing when you click?
Nov 19 '12 #3
NeoPa
32,556 Expert Mod 16PB
You can use the Dir() function (carefully) to determine if a file or folder exists (See below for my Exist() function that uses this.) and MkDir() (As Rabbit suggested) to create it if it doesn't.

Other than that you just need the logic of exactly what you want to do. We may be able to help with that if you make a start from what's here, but we avoid simply writing code for members. That's a waste of everyone's time.

Expand|Select|Wrap|Line Numbers
  1. 'Exist() returns true if strFile exists.  By default ignores folders.
  2. '22/05/2003 Rewritten with better code.
  3. '20/05/2005 Added finding of R/O, System & Hidden files.
  4. Public Function Exist(strFile As String, _
  5.                       Optional intAttrib As Integer = vbReadOnly Or _
  6.                                                       vbHidden Or _
  7.                                                       vbSystem) As Boolean
  8.     Exist = (Dir(PathName:=strFile, Attributes:=intAttrib) <> "")
  9. End Function
Nov 19 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: skgolden | last post by:
My husband and I own a small temporary labor company and deal with 4 major clients (A,B,C & D), each of which has about 2 dozen units in our tristate area that we deal with (ie, Company A, units...
1
by: Jamie Pittman via AccessMonster.com | last post by:
Does anyone have any suggestion how to create this form. I want to be able to have form that has two fields and that allow me to select specific parmeters for my Union Query to Look up? I have a...
0
by: Lane | last post by:
Im looking for a way to dynamically append a textbox to a dataset in a form then be able to access the textbox contents to update the dataset. Response.Write("<Form id='form1' runat='server'...
3
by: kpuchala | last post by:
Hello I'm beginnig to create my first application in Visual Web Debeloper 2005 Express. I need to create a web site (simple application), which will allow to list objects (records) stored in...
3
by: anthopper | last post by:
hello-i am a new access user--access 2003 winXP pro. I am trying to create a form with a subform that will allow me to navigate though all of the records from a single table. From a formatting...
8
by: Paul H | last post by:
I want to base a form on a crosstab query. The query shows statistics for a user defined period. The column headings will look something like this: ClientID Month01 Month02 Month03 etc.. ...
6
by: coolestavi007 | last post by:
Hi, I have to create directories on the FTP server. I have tried directory.exists but it doesnt work.Any other way to create directory on the server.Please help me.
15
by: jt196 | last post by:
I'm trying to create an editable form of fulfilled orders on my system and am running into problems with creating a form based on this query. The field that I need to update (invoice number) is...
4
by: Kelly Warden | last post by:
I want to create a form in Access to update my table automatically with the information selected from combo boxes, lists, comments, etc. Also, I want to automate this w/ some VBA or SQL or...
1
by: ncsthbell | last post by:
I am using MS access 2007. I want to create a form that when opened will contain all blank columns (to do this I believe I do not include a record source on the forms property). I want the user to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.