Hyperlink

maxkhan

New member
Local time
Today, 11:31
Joined
Jul 6, 2009
Messages
2
Hi All, I need help to sort out linking problem.
I have a command button, what I wants to do it when I click it, window explorer window opens up and user can select a file, It should be store in field call Document_link as hyperlink.

can someone help me... this what I am using... I have tried with private also ...getting complile error : Method or data member not found...


Public Sub Command13_Click()
Me.[Document_Link].SetFocus
DoCmd.RunCommand acCmdInsertHyperlink


End Sub
 
max,

you need the file dialog picker. look that up in the help menu. something like this would be useful:
Code:
      With Application.FileDialog(msoFileDialogFilePicker)

         With .Filters
           .Clear
           .Add "All Files", "*.*"
         End With

             .AllowMultiSelect = True
             .InitialFileName = Me.Text1
             .InitialView = msoFileDialogViewDetails

                    If .Show Then

                      For Each varitem In .SelectedItems

                           DO WHATEVER HERE WITH THE "VARITEM" FILES YOU CHOOSE

                      Next varitem

                    End If

      End With
i attached a sample for ya if you want to look at it...
 

Attachments

Hi ajetrumpet, thanks for quick respond. It doesn't do what I am trying to.
My thing is select a file from and just place a hyperlink in text box... so when user click the hyperlink it open up the file .

Please see attached...I have change one thing in your sample as it was not working... .now it open up the window explorer and allow me to select file but I am unable to have hyperlink.

Thanks
 

Attachments

Here is what i have done, ( i am using the same thing)

my code:
'Image button Magazine_Entry [Cover_Image]
Private Sub Command15_Click()
Me.[Cover_Image].SetFocus
DoCmd.RunCommand acCmdInsertHyperlink
End Sub

i have a form with a table from my tblMagazine, there is a cell called (linked) to my cover_image in that table. On my form i have the cell ready for me to right click/hyperlink etc.. and i have a button to the right of that called (Image) but carries the command15 name to it. Mine works fine, I am not sure if you have some spaces somewhere (or if it matters). dumb question though. make sure your cell or Cover_Image (in my case) is set to data type "hyperlink". I am WAY from being anyone who is an expert on access but this is how mine is set up. Hope that helps.
 
TRAG,

i don't have A2007, so I don't have the hyperlink field. What I have now done is populated the textbox with the link from what is selected in the file dialog picker. I have the text as blue and underline. what I would do after this is put a double click event on the textbox and use:
Code:
application.followhyperlink
in the code behind the event. If you have 07 though, use a hyperlink field and you should be just fine after you give the box it's value. That's all I can do here. Good luck bro~!
 

Attachments

Far too complicated; just create a text field linked to a field in your table and set the table DataType property to hyperlink.

Whatever you type in the textbox will open (document or web URL)
 

Users who are viewing this thread

Back
Top Bottom