I have a visual basic module within Access that seems to compile fine; when I select the Debug function in the visual basic editor, I receive no errors or messages. However, within my Access form, when I try to click the button associated with this module, I receive the error message, "Automation Error. Invalid Advise Tags"
I have tried to google this error message and get no results. Neither do I get acceptable results for "advise tags", "invalid tags visual basic", or "invalid tags vb." Has anyone gotten this error before, and do you know what it means? Can anyone explain what an "advise tag" is?
FYI the button is supposed to open Word and a particular Word document. The coding is below:
Option Compare Database Option Explicit Private Declare Function SetCurrentDirectoryA Lib _ "kernel32" (ByVal lpPathName As String) As Long
Sub ChDirNet(szPath As String) Dim lReturn As Long lReturn = SetCurrentDirectoryA(szPath) If lReturn = 0 Then Err.Raise vbObjectError + 1, "Error setting path." End Sub
Private Sub close_form_Click() On Error GoTo Err_close_form_Click
If Me.Dirty Then Me.Dirty = False DoCmd.Close
Exit_close_form_Click: Exit Sub
Err_close_form_Click: MsgBox Err.Description Resume Exit_close_form_Click End Sub
Private Sub open_word_file_Click() On Error GoTo Err_open_word_file_Click
Dim retVal As Variant DoCmd.SetWarnings False ChDirNet "
\BasenetworkserverceoSecurity" retVal = Shell("C:Program FilesMicrosoft OfficeOffice12WINWORD.EXE & ""Y:SecuritySecurityMemo.doc""", vbNormalFocus)
Exit_open_word_file_Click: Exit Sub
Err_open_word_file_Click: MsgBox Err.Description Resume Exit_open_word_file_Click End Sub
Software/Hardware used:
Access 2007
ASKED:
May 17, 2011 5:00 PM
UPDATED:
May 17, 2011 5:30 PM