Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2015

    Unanswered: Hyperlink not displaying correctly

    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
    End If
    Set doc = appWord.Documents.Open("C:\Users\Kirk Desktop\Documents\Word Docs\ToolCribLabels\Resistor.docx", , True)
    With doc
    .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
    End With
    Set doc = Nothing
    Set appWord = Nothing
    Exit Sub
    MsgBox Err.Number & ": " & Err.Description
    End Sub

  2. #2
    Join Date
    Apr 2014
    Provided Answers: 23
    I dont see a hyperlink anywhere in this code.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts