I have an Access database that includes some large(ish) text fields. In a Report I’d like Access to scan the text and hyperlink any word(s) that we have an entry for in another Table.
So say it says, “The Financial Services Authority (FSA) said that it could veto American efforts to impose regulation on the London oil market, as the City took center stage in an escalating row over the role of speculators in driving up the global price of crude oil.”
I’d like Access to output, "The Financial Services Authority (FSA) said that it could veto American efforts to impose regulation on the London oil market, as the City took center stage in an escalating row over the role of speculators in driving up the global price of crude oil. " (note the hyperlink)
Is there any way to do this?
If the answer is too complex for here if someone could point me to a website that explains it or a Google search that will get me there I’d appreciate it (my Google-Fu is failing me on this particular problem).
Hmm…I am not very good with Access but I am good with VBScript/ASP so maybe I can get you started?
I would do it something like this…
ReportText = ReportTable.TextField
For Each Row In PhrasesTable.GetRows()
ReportText = Replace(ReportText, [Phrase], "<a href=" & & ">" & [Phrase] & "</a>"
MoveNext()
Loop
Oh man…it seems that I’ve been doing so much C# lately that I have completely lost my mind when it comes to VB. Does that help at all? The syntax is horrible but the general idea is there (Replace(string, original, new) IS a real VB function…)