Run time error 2494

  • Thread starter Thread starter TotallyConfused
  • Start date Start date
T

TotallyConfused

I am trying to understand this. I inherited a db with this code in the form.
When I test this in the Immediate Window it gives me this error:

Run-Time error 2494 - The action or method requires a form Name argument.
There is such a form which is referenced here. Can someone please explain?
thank you.


Private Sub Label7_Click()
On Error GoTo Err_Label7_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "NE_File_Type_Selection"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Label7_Click:
Exit Sub

Err_Label7_Click:
MsgBox Err.Description
Resume Exit_Label7_Click
End Sub

Private Sub Label8_Click()
On Error GoTo Err_Label8_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Myformname"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Label8_Click:
Exit Sub

Err_Label8_Click:
MsgBox Err.Description
Resume Exit_Label8_Click
End Sub
 
Back
Top