I am developing a form with a tab control to take the place of a form with multiple subforms. Hopefully, the new form will improve functionality and appearance. The tabs will contain the subforms.
A command button control, which works on the current form, enables the user to view a stored document if it is in a certain location. If the document is not in a specified location a 'cannot find' message pops up.
I copied the code associated with this button to the new form but now I get a compile error: Method or data member not found. How can I get this to work?
Here's the code I'm using.
Private Sub cmd_ViewForm_Click()
'Set variables for lan directories relating to form field entries
Dim strLinkFileID As String 'Complete network path and specific file info
strLinkFileID = "\\MFXDOCCDD01\Development\Business_Teams\Product_Development\TRIWAY_FORMS\" & _
Me.txt_FormAuthor & "\" & Me.cbo_TerrID & "\" & Me.cbo_FormType & "\" & (Me.Form_nm & " " & _
Me.Form_vdt & ".doc")
'Error Check if file exists - provide not found message, and exit before executing additional code
If Dir(strLinkFileID) = "" Then
MsgBox "A file does not exist for this form in the specified location."
Me.cmd_ViewForm.HyperlinkAddress = ""
Exit Sub
Else
FollowHyperlink strLinkFileID
End If
End Sub
A command button control, which works on the current form, enables the user to view a stored document if it is in a certain location. If the document is not in a specified location a 'cannot find' message pops up.
I copied the code associated with this button to the new form but now I get a compile error: Method or data member not found. How can I get this to work?
Here's the code I'm using.
Private Sub cmd_ViewForm_Click()
'Set variables for lan directories relating to form field entries
Dim strLinkFileID As String 'Complete network path and specific file info
strLinkFileID = "\\MFXDOCCDD01\Development\Business_Teams\Product_Development\TRIWAY_FORMS\" & _
Me.txt_FormAuthor & "\" & Me.cbo_TerrID & "\" & Me.cbo_FormType & "\" & (Me.Form_nm & " " & _
Me.Form_vdt & ".doc")
'Error Check if file exists - provide not found message, and exit before executing additional code
If Dir(strLinkFileID) = "" Then
MsgBox "A file does not exist for this form in the specified location."
Me.cmd_ViewForm.HyperlinkAddress = ""
Exit Sub
Else
FollowHyperlink strLinkFileID
End If
End Sub