I am new to this forum and relatively new to VBA programming in general. I am working on a database that tracks inventory in out company. I have several simple forms that display various types of electronic components. I am trying to create a way to print out new bin labels when new components are added to the database. This information is fed to a Word program with the correct label template. Everything is working fine until I get to the part number of the component which is set up as a hyperlink so it can aid us in reordering. Instead of displaying the Hyperlink text (the part number), the word program displays the hyperlink address. Is this a problem with the Way word is receiving the info or the way access is sending it. In short is there a way I can remedy this problem. I have included the VBA code if anyone has any suggestions:
Private Sub Command37_Click()
'Pass form data to Word Label Document
Dim appWord As Word.Application
Dim doc As Word.Document
'Avoid error 429, when Word isn't open.
On Error Resume Next
'Set appWord object variable to running instance of Word.
Set appWord = GetObject(, "Word.Application")
If Err.Number <> 0 Then
'If Word isn't open, create a new instance of Word.
Set appWord = New Word.Application
Set doc = appWord.Documents.Open("C:\Users\Kirk Desktop\Documents\Word Docs\ToolCribLabels\Resistor.docx", , True)
.FormFields("fldToolCribCategory").Result = Me!ToolCribCategory
.FormFields("fldResistance").Result = Me!Resistance
.FormFields("fldWattageR").Result = Me!WattageR
.FormFields("fldToleranceR").Result = Me!ToleranceR
.FormFields("fldPackageR").Result = Me!PackageR
.FormFields("fldDistributor").Result = Me!Distributor
.FormFields("fldDistributorPN").Result = Me!Distributor_PN
.Visible = True
Set doc = Nothing
Set appWord = Nothing
MsgBox Err.Number & ": " & Err.Description