There is just one line of code that is supposed to fire when the labels are clicked: "formName.show". If I put a breakpoint on this line of code and then click on the label, the breakpoint is never reached.
I also tried to recreate this error on a very simple test document but was unable to. So I guess that means the problem is related to the code. Here's the code in the document_New event:
processClarificationOrder = False
'default status OR COULD PULL FROM DATABASE!!!!!!!!!!!!!!!!!
ActiveDocument.lblStatus = "PHYSICAL THERAPY STATUS REPORT - Initial Evaluation"
'set default site. Pull from registry
Dim defaultSite
defaultSite = GetSetting(appname:="PT_Trans", Section:="appInfo", _
Key:="defaultSite") ', setting:=cmbSite)
'fill out address info
On Error Resume Next
ActiveDocument.lblSite = defaultSite & " " & GetSetting(appname:="PT_Trans", Section:="sites", _
Key:=defaultSite, Default:="No Address Found")
On Error GoTo 0
Dim Temp, defaultPhone
On Error Resume Next
defaultPhone = GetSetting(appname:="PT_Trans", Section:="phoneNumbers", _
Key:=defaultSite, Default:="")
On Error GoTo 0
' defaultPhone = ""
'fill out phone info at bottom of page
' ActiveDocument.lblQuestions = "If you have any questions or concerns please call " & defaultPhone
Selection.GoTo What:=wdGoToBookmark, Name:="beginDoc"
mainForm.Show
'get connection to db
Dim conn As New ADODB.Connection
Dim connectString As String
conn.Provider = "sqloledb"
connectString = "Server=bhs_hospice;Database=rehabTemplate;user id=USER;password=PWD;Trusted_Connection=yes"
conn.Open connectString
Dim Rs As New ADODB.Recordset
Dim sql As String
sql = "SELECT DISTINCT lineItems.groupID "
sql = sql & "FROM lineItems, templateGroups "
sql = sql & "WHERE lineItems.groupID = templateGroups.groupID "
'sql = sql & "AND templateGroups.templateName = 'ortho'" '& "'" & templateName & "' "
sql = sql & "AND templateGroups.templateName = '" & templateNameSetting.templateName & "' "
sql = sql & " ORDER BY lineItems.groupID"
Rs.Open sql, conn
'THE FORMS IN THIS WHILE LOOP GENERATE TEXT USING SELECTION.TYPETEXT STATEMENTS
While Not Rs.EOF
'open a form for each group
globalGroupID = Rs.Fields("groupID")
rehabInitial.Show
Rs.MoveNext
Wend
Selection.TypeParagraph
turnBulletsOff
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText Text:="The patient's goals have been discussed with the patient and/or significant other."
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText Text:="_________________________________________"
Selection.TypeParagraph
Selection.TypeParagraph
Selection.MoveDown
'Open the Medicare form. (NOTE: This form contains a yes and a no button. If yes is clicked, a selection.typeText statement is run. If no is clicked, the form unloads.)
medicareForm.Show
'fill out phone info at bottom of page
Set ctrlLabel = ActiveDocument.InlineShapes.AddOLEControl(ClassType:="Forms.Label.1", Range:=Selection.Range)
This last line is the problem. If I omit the line all label events work fine. If I include the line the code in label.click never executes.