define a database path

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

my application use a database and needs its path for many functions.
I have a dialog box to choose the path but i call it every time i call a
function, it's not really user friendly

So how can i define the path at the first opening of my application, and
stock the path anywhere so the dialog box won't appear anymore?

Many thanks
 
John Walkenbach shows a way to browse for folder at:
http://j-walk.com/ss/excel/tips/tip29.htm


You could ask once and keep that folder name in a public variable--declare it
outside the any function/procedure.

Option Explicit
Public MyFolder as string

Sub test1()
if myfolder = "" then
myfolder = GetDirectory("Select A folder")
end if

'...do lots of stuff
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top