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