update the hyperlink address at same time as appending data in to table

Dharmesh Patel

New Member
Joined
May 12, 2009
Messages
25
I have created excel file susing macro in access and updated an Access table with the location of the files. The table column data type is hyperlink. How can I set the address of teh hyperlink at the sametime as I update the table.

e.g the location column in the table "Created files" is a hyperlink data type, once a file is created the location column gets updated with "C:\DHARMESH\PRODUCT\AMERICAS.XLS". How can I set the address of the hyperlink at the same time as updateing the column.

I use the DOCmd.run sql to update the table.
dpSQL = "INSERT INTO TPGCreated(File,Centre,Date_Completed,Pivotal_Reference,TourName,TourDate,TourTime,ASDASM,SaleEmail,Location,TourCentre) VALUES (""" & FileName.Value & """,""" & CentreNumber.Value & """,""" & Now() & """, """ & PivRef.Value & """, """ & TourName.Value & """, """ & Tour_Date.Value & """, """ & Tour_Time.Value & """, """ & ASDASM.Value & """, """ & SaleEmail.Value & """, """ & xlSaveFile & """, """ & TourCentre.Value & """)"
DoCmd.RunSQL dpSQL
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
I don't understand you issue, why can't you update the other field if you know the location
 
Upvote 0
Hi,
I can update the field, but the hyperlink dose not work. For example, I am able to update the "Location" filed (Hyperlink datatype) with "C:\DHARMESH\PRODUCT\AMERICAS.XLS". However when I click on the link nothing happens. I have to manually go and set the address of the hyperlink in each record currently.

Is thera away to loop through each record in Loaction field and set the hyperlink address to the data in the Location Field?


Hope that explains the problem.
Regards
Dharmesh
 
Upvote 0
Silly me,
Recorded macro to find the solution.

.Hyperlinks.Add Anchor:=Selection, Address:= _
"C:\Desktop\Tour price guides\new", TextToDisplay:= "C:\Documents and Settings\dharmesh.patel\Desktop\Tour price guides\new"

Regards
Dharmesh
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top