Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: How Do I Allow Users to Input Paths?

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

How Do I Allow Users to Input Paths?
Dustin Ventin 13.07.2006 21:45:01
My latest question:

I have a series of buttons that export data to Excel using the
DoCmd.TransferSpreadsheet command. This works fine. However, we want to
allow users to choose which Excel file the export to. I have added a textbox
that allows users to click on, and it opens the acCmdInsertHyperlink dialouge
box that allows the user to input a path.

Then, my program replaces the default path for the Excel file with the one
the user prefers. The problem is, my actual path is something like
"C:\Program Files\File.xls", the program comes up with a hyperlink like
"../../Program Files/File.xls", and when my program tries to export, it reads
it as "C:\Dustin's Stuff\Program Files\Program Files\File.xls", which is a
majorly messed-up combination of the application location and the path it
should be using.

Any idea why it's doing this and how to fix it?

Problem #2...if the path the user tries to input is too long...such as
"C:\Program Files\RiskAmp\Bart Simpson\Test.xls", no hyperlink is saved at
all and no error message is displayed. Any idea why?

Thanks!

Dustin
Re: How Do I Allow Users to Input Paths?
"Dirk Goldgar" <dg[ at ]NOdataSPAMgnostics.com> 13.07.2006 22:05:04
"Dustin Ventin" <DustinVentin[ at ]discussions.microsoft.com> wrote in
message news:18F5A285-70D5-413E-8DBE-F8ECACABAA43[ at ]microsoft.com
[Quoted Text]
> My latest question:
>
> I have a series of buttons that export data to Excel using the
> DoCmd.TransferSpreadsheet command. This works fine. However, we
> want to allow users to choose which Excel file the export to. I have
> added a textbox that allows users to click on, and it opens the
> acCmdInsertHyperlink dialouge box that allows the user to input a
> path.
>
> Then, my program replaces the default path for the Excel file with
> the one the user prefers. The problem is, my actual path is
> something like "C:\Program Files\File.xls", the program comes up with
> a hyperlink like "../../Program Files/File.xls", and when my program
> tries to export, it reads it as "C:\Dustin's Stuff\Program
> Files\Program Files\File.xls", which is a majorly messed-up
> combination of the application location and the path it should be
> using.
>
> Any idea why it's doing this and how to fix it?
>
> Problem #2...if the path the user tries to input is too long...such as
> "C:\Program Files\RiskAmp\Bart Simpson\Test.xls", no hyperlink is
> saved at all and no error message is displayed. Any idea why?
>
> Thanks!

Instead of mucking about with hyperlinks, why not call the Windows File
Open/Save API directly, using the code at:

www.mvps.org/access/api/api0001.htm

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


Re: How Do I Allow Users to Input Paths?
Dustin Ventin 27.07.2006 22:16:02
That is a lot of code to make that one stinkin' window pop up...but it works,
so thanks!

Dustin
RE: How Do I Allow Users to Input Paths?
Sarella 31.08.2006 11:32:01

Hi,

Had a similar problem and found this site with the code in - Works a treat!
http://www.tkwickenden.clara.net/codeex/259.htm

Hope it helps you too

"Dustin Ventin" wrote:

[Quoted Text]
> My latest question:
>
> I have a series of buttons that export data to Excel using the
> DoCmd.TransferSpreadsheet command. This works fine. However, we want to
> allow users to choose which Excel file the export to. I have added a textbox
> that allows users to click on, and it opens the acCmdInsertHyperlink dialouge
> box that allows the user to input a path.
>
> Then, my program replaces the default path for the Excel file with the one
> the user prefers. The problem is, my actual path is something like
> "C:\Program Files\File.xls", the program comes up with a hyperlink like
> "../../Program Files/File.xls", and when my program tries to export, it reads
> it as "C:\Dustin's Stuff\Program Files\Program Files\File.xls", which is a
> majorly messed-up combination of the application location and the path it
> should be using.
>
> Any idea why it's doing this and how to fix it?
>
> Problem #2...if the path the user tries to input is too long...such as
> "C:\Program Files\RiskAmp\Bart Simpson\Test.xls", no hyperlink is saved at
> all and no error message is displayed. Any idea why?
>
> Thanks!
>
> Dustin

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net