Thanks to basodre i've managed to let excell add a hyperlink to every datapulled rows in my Excellsheet. Next step would be to save a text "Data confirmed" in Access once the hyperlink , behind a particular row, gets clicked. For example, there are 10 lines with a hyperlink "click to confirm" at the end. Once data of line 8 is correct, one will have to click "click to confirm" on row 8. Once clicked, it should save "Data confirmed" to access for row 8.
I currently have following code but it still doesn't save "Data confirmed" in my access file once clicked on the hyperlink. Any ideas?
Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
'Confirm that this is a hyperlink in column 3
If Not Intersect(Target.Range, Columns(16)) Is Nothing Then
MsgBox SaveData(Target.Range)
End If
End Sub
Private Function SaveData(rng As Range) As Boolean
Dim cnDB As New ADODB.Connection
VsDBPath = ThisWorkbook.Sheets("Settings").Range("B2").Value
cnDB.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=" & VsDBPath & ";" & "Jet OLEDB:Engine Type=5;" & "Persist Security Info=False;"
cnDB.Execute "INSERT INTO NewPO (Confirmation) VALUES ('Data confirmed')"
cnDB.Close
SaveData = True
End Function