473,501 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Browse to file & save as URL

As a Newbie to VBA, I've just had a successful conclusion to a
protracted struggle with attempts to open a browse window that allows
one to find a file and have that file's path saved in a bound control
that is set as a hyperlink.

I started with the code in http://www.mvps.org/access/api/api0001.htm.

Whilst this dropped the path into the correctly into the control, it
would not work as a hyperlink. But with a bit more ferreting around
the NG, I came across the solution which was to add a prefix to the
path as follows:-

Me.TxtURL = "#file://" & strInputFileName & "#"

This might be useful to some of the other Newbies out there.

Now, being as ambitious as ever, I want to get the browse window to
start at a particular folder on the network. At present it opens at
'My Documents'.

Any ideas how we can get round this?

Yvonne

Jun 21 '07 #1
2 4032
On Thu, 21 Jun 2007 11:43:09 -0700, Dulwich <lo******@yahoo.co.uk>
wrote:

Excellent work so far! I like your attitude.

To get the FileOpen dialog to start at a particular folder, you need
to set the InitialDir field of the OPENFILENAME type. There actually
is an example of that right on that page:
MsgBox "You selected: " & ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Hello! Open Me!")

-Tom.
>As a Newbie to VBA, I've just had a successful conclusion to a
protracted struggle with attempts to open a browse window that allows
one to find a file and have that file's path saved in a bound control
that is set as a hyperlink.

I started with the code in http://www.mvps.org/access/api/api0001.htm.

Whilst this dropped the path into the correctly into the control, it
would not work as a hyperlink. But with a bit more ferreting around
the NG, I came across the solution which was to add a prefix to the
path as follows:-

Me.TxtURL = "#file://" & strInputFileName & "#"

This might be useful to some of the other Newbies out there.

Now, being as ambitious as ever, I want to get the browse window to
start at a particular folder on the network. At present it opens at
'My Documents'.

Any ideas how we can get round this?

Yvonne
Jun 22 '07 #2
On 22 Jun, 02:53, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
On Thu, 21 Jun 2007 11:43:09 -0700, Dulwich <loyal...@yahoo.co.uk>
wrote:

Excellent work so far! I like your attitude.

To get the FileOpen dialog to start at a particular folder, you need
to set the InitialDir field of the OPENFILENAME type. There actually
is an example of that right on that page:
MsgBox "You selected: " & ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Hello! Open Me!")

-Tom.
You rode to the rescue again and got me in the right direction.

I tried modifying the section above with the full path, but that just
took me into the root of C: and no further

I then dabbled at the other potential opportunities and further down
the module I made the folloing change that worked a treat.

Dim fResult As Boolean
' Give the dialog a caption title.
If IsMissing(InitialDir) Then InitialDir = "G:\DFAT\Passports"
If IsMissing(Filter) Then Filter = ""

Many thanks

Yvonne
Jun 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2952
by: Rob | last post by:
Help me, I'm just beginning with programming in Access 2000. I've tried the http://www.mvps.org/access/api/api0001.htm but it won't work in Access. What am i doing wrong. I don't have...
0
1460
by: jason | last post by:
some confusion here. The below code allows me to save a local file to my web server and somehow because the field type is file a local file browse button is rendered. I'm trying to figure out...
5
3113
by: Mike Moore | last post by:
I need to create something very similiar to the browse folder capability. This would allow me to support the following - A user would create a document on their server, then they would need to...
3
5389
by: den 2005 | last post by:
Hi everybody, I like to allow user to select and browse to which location to save the pdf file of a crystal report viewed on a web page, how can i do this in ASP.Net? I need to get the path...
4
3092
by: DMG | last post by:
I have <identity impersonate = "true" /& <authentication mode="Windows"/in the web.config. This is a 2.0 site. My Goal: I want to simply have the user browse to a file on a mapped drive and get...
4
2374
by: developing | last post by:
Hi All, I have a browse button that the user can click to select a file. The button then fetches the file path. This is all working fine except my boss wants some add functionality. I need it to...
7
2667
by: ConfusedAlot | last post by:
This is my code for a database, whenever i save the database to the file 'database.txt' and display the results i get this; name - (correct, is what i put in) pin - 3435973836 slew rate -...
1
1961
by: developing | last post by:
Hello, This time I want to filter the 'browse for file' API so that certain drives/folders cant be accessed. Not sure how to go about this...here is the module I am currently using to browse...
3
5195
by: ApexData | last post by:
I am using code from the following links to establish a Browse File and Browse Folder dialog. http://www.mvps.org/access/api/api0001.htm http://www.mvps.org/access/api/api0002.htm This code...
0
7164
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7046
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7232
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6937
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7424
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5523
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4958
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3127
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1468
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.