Run time error 2494

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top