Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I open a folder via access?

Status
Not open for further replies.

punderful

Programmer
Dec 14, 2002
28
0
0
US
I had this great idea roughly "wouldn't it be nice to be able to click a button on my form that would open the folder that relates to the current form record". Does anyone know how I would go about coding the on click event? Thanks!
 
what is a folder that relates to the current form record?

Intrinsically, records and folders have little in common.
 
Hey,
yeah that's a good idea. I've had it implemented for about a year now, it works very nicely.

It takes several steps to get to this point where you have a button that takes you to the folder.

You have to create the folder
mkdir "foldername" 'this could occur at any time you need the folde rto be created. it creates and error though if the folder already exists.

You have to save the path of the folder name in a table
fieldname = foldername
You should have to create a button that takes you there.
I made one button that does both events.

If you look at microft's help file on hyperlinks, it will tell you how to assign hyperlink properties on a control button that will take you to your folder.

the hyperlink would be something like:

private btnGotofolder()
dim stFolder as string
dim ctl as control

stFolder = me!folderName 'where folder name is a field in your form. I have a more complicated string, it includes the first and last name of a client and their ID number, almost every one gets a folder.

set ctl = me!btnFolder
with ctl
.Visible = False
.hyperlinkaddress = stFolder
.hyperlink.follow
end with

end sub Mark P.

Bleh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top