I have listed the code for a form I built in Access. When the control button is pressed, the database file should open. This code works in Word, but it doesn't work when I use it in Access. The Sub (Access.Private Sub Command10_Click()), is where this event should take place, but I get the following error, "Runtime error '424' Object Required." What am I missing?
Option Compare Database
Private Sub Command1_Click()
On Error GoTo Err_Command1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "mainFRM"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command1_Click:
Exit Sub
Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub
Private Sub Command10_Click()
ActiveDocument.FollowHyperlink "F:\FUNCTIONAL_USERS\WMS DATABASE REPORT REPOSITORY\EXCEED_WMS_TABLE1.mdb", , True
End Sub
Option Compare Database
Private Sub Command1_Click()
On Error GoTo Err_Command1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "mainFRM"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command1_Click:
Exit Sub
Err_Command1_Click:
MsgBox Err.Description
Resume Exit_Command1_Click
End Sub
Private Sub Command10_Click()
ActiveDocument.FollowHyperlink "F:\FUNCTIONAL_USERS\WMS DATABASE REPORT REPOSITORY\EXCEED_WMS_TABLE1.mdb", , True
End Sub