Hyperlink default

N

Natalie

I have a click button that takes me to the edit hyperlink window. I would
like to have that window go directly to a default location. Is there a way to
do this?
 
N

Natalie

What the heck kind of post was that. This is a microsoft website, not some
porn site.
 
B

bad man

so can I take your pants off and put my hand between your legs?

Or do you just want to lie down naked on the floor and begin masturbating
and playing with your tits?
 
N

Natalie

grow-up and get over yourself...

bad man said:
so can I take your pants off and put my hand between your legs?

Or do you just want to lie down naked on the floor and begin masturbating
and playing with your tits?
 
N

Natalie

Can anyone with real techinical knowledge please help me so I don't have to
keep referring to bad man's perverted posts?
 
J

J. Goddard

I have sent a complaint to the abuse contact for the ISP that appears to
be the source of the posting (xpedius.com). Looks like it might be some
sicko at one of their customers.

John
 
J

John Nurick

Hi Natalie,

I guess your button uses
DoCmd.RunCommand acCmdEditHyperlink
on a control that's bound to a hyperlink field.

If the field is empty, the Edit Hyperlink dialog opens at the current
folder and I don't think there's any way to change that. But if there's
a value in the hyperlink field, Edit Hyperlink attempts to open in the
corresponding folder.

So maybe you can achieve what you want by either

(1) setting a default value for the hyperlink field, or the textbox
bound to it. This default value
C:\Temp#C:\Temp
makes Edit Hyperlink open in C:\Temp.

Or (2) have the code behind your button set the field to the appropriate
value before calling EditHyperlink, e.g.

Me.MyHyperlinkControl.Value = "C:\Temp#C:\Temp"
Me.MyHyperlinkControl.SetFocus
DoCmd.RunCommand acCmdEditHyperlink
 
N

Natalie

I tried this, but it didn't really achieve what I wanted it to do. It did set
the text to display and address to the drive that I selected, but the folder
that is display and that you're actually looking in is different. Any other
suggestions? Is what I'm asking to do possible?
 
J

John Nurick

Natalie,

I'm not sure I understand what you're trying to do. As a start, can you
post the code behind your button and explain where the "default
location" is stored.
 
N

Natalie

This is the code for the click button:


Private Sub cmdEditLink_Click()
On Error GoTo Err_cmdEditLink_Click

Me.View_PDF.Value = "H:\TECHSVC\IT Purchases\FY 2006-2007#H:\TECHSVC\IT
Purchases\FY 2006-2007"
Me.View_PDF.SetFocus
RunCommand acCmdEditHyperlink

Exit_Point:
Exit Sub

Err_cmdEditLink_Click:
If Err.Number <> 2501 Then
MsgBox Err.Description, vbExclamation, "Error " & Err.Number
End If
Resume Exit_Point

End Sub

When I click on this button it takes me to the edit hyperlink window and the
destination (look in) folder is H:\TECHSVC\IT Purchases\Database. I want it
to be what's shown above that way everytime I place a hyperlink, I don't have
to look for the "FY 2006-2007" folder. Does that make sense? Is that possible?
 
J

John Nurick

I see what you mean. The Edit Hyperlink dialog seems to start in
CurrentProject.Path (the folder where the current database is located)
and so far I haven't been able to find or think of a way to change this.

One solution would be to "roll your own". Use the code at
www.mvps.org/access/api/api0001.htm to open the ordinary File Open
dialog, defaulting to the folder you want. Let the user select the file,
and then have your code assemble an Access-style hyperlink field value
and insert it into the textbox or the underlying field.
 
N

Natalie

I noticed that too. I actually just before you updated this. I ended up
storing the database file in the folder that the links were in, and that
allowed the database to accomplish what I was trying to do. The users don't
have a problem with that, so that was the fix I was going to stick with. A
few hyperlinks were affected by the move, but it wasn't a big deal since this
was a new database I had made and there was not much data in it yet. So
problem solved. Thanks for all your help.
 
Top