Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    509

    how to insert a hyperlink?

    I'm inserting a hyperlink into the same field, in the same table, in two (2) different manners (I do need both: 1, adds a new record, and the other edits an existing record.) The first of them works, the other does not (and I'm looking for why it doesn't...

    in the one that does work, (the field that contains the hyperlink is being edited)
    the user selects a file to which the hyperlink is connected, and the existing record is updated



    in the one that does NOT work, (an set of records is being added to the table)
    I am inserting a set of records from another table. In that data source table, those records already have the hyperlink, and the hyperlinks do work. When they are inserted into the new table, they do not link ("file path not found")

    any thoughts whatsoever would be greatly appreciated,
    mark


    ------------------------

    ***this method does work

    With Application.FileDialog(3) ' 3 is a constant: msoFileDialogFilePicker
    .Title = "Select page"
    .Filters.Clear
    .Filters.Add "All Files", "*.*"
    .Filters.Add "JPGs", "*.JPG"
    .Filters.Add "BMPs", "*.BMP"
    .FilterIndex = 2
    .AllowMultiSelect = False
    .InitialFileName = CurrentProject.path
    result = .Show
    If (result <> 0) Then 'result = 0 if nothing was selected
    fileName = Trim(.SelectedItems.Item(1)) 'filename contains the path you want.
    End If
    End With
    If Len(fileName) > 0 Then
    Me.CatalogSheetLink = "#" + fileName
    End If


    ***this method does not work

    Dim sSQL As String
    sSQL = "INSERT INTO tbeAdditionalPages (type, printCatalogSheet, BaseCatalogSheet, CatalogSheetLink, PrintOrder, IsMountingDetail) " & _
    "SELECT '" & Forms![frmSpec].[Type] & "', true, true, '#' & CatalogSheetLink, printOrder, false " & _
    "FROM FixtureCatalogsPages " & _
    "WHERE Manufacturer = '" & Forms![frmSpec].Manufacturer.Value & _
    "' and CatalogNumber = '" & Forms![frmSpec].CatalogNo.Value & "';"
    CurrentDb().Execute sSQL, dbFailOnError

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    first one must be sure that the file path is indeed valid. if it involved any shortcuts and doesn't contain the full path from the root drive - - then this could be the problem.

    but presuming the file path is valid; you need to lookup the Hyperlink Method in help. It is one field type where 'what you see is not what you get' so to speak. It has multiple parts, some not showing - and what you need to write is the correct part of the full string. It's been a couple years since I had to do a mass change of hyperlinks via a one time query so can't remember the specifics off hand - - but I think this is the direction you need to go.

    Hope this helps a little.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. INSERT query: insert new data only
    By drh in forum Access
    Replies: 2
    Last Post: 04-04-2014, 05:31 PM
  2. Where is the hyperlink....
    By amer in forum Queries
    Replies: 1
    Last Post: 06-09-2010, 12:06 PM
  3. Hyperlink in Report?
    By cadsvc in forum Reports
    Replies: 0
    Last Post: 05-11-2010, 07:27 PM
  4. Hyperlink Help
    By smikkelsen in forum Access
    Replies: 9
    Last Post: 03-12-2010, 11:28 AM
  5. Hyperlink problem
    By peterl in forum Programming
    Replies: 0
    Last Post: 01-13-2009, 07:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums