DialogBox cannot be used in this context; a document must be selected

Error: DialogBox cannot be used in this context; a document must be selected.

Code:

If Not w.DialogBox (“SelectionDialogBackLogReport”,True, True, False, False,False, False, “Select the backlog report period”, dlgdoc, True, False) Then

Exit Sub

End If

Process:

I use the above code in an action menu agent. The form name and the name used as the first parameter in the DialogBox method is same.

Still I receive this error in 8.5. it works perfectly in 6.5!

I have checked the forum posts but none answer the question as to why it does not work in 8.5!

Is this a 8.5 bug?

Is there any work around to rectify this?

Thank you for your help in advance!

Subject: Double-check the form name

I had this error last week in 7.0 and it ended up being a typo in the form name. Make sure the form exists.

Subject: Same problem here, in 8.5.2

I also experiencing the same issue and found, similar to a previous poster, that there was a typo in the form name. The message is rather unhelpful!

PW

Subject: I have the issue too

I have similar code. It was working fine through many versions R6.5, R7, R8.0, and now in R8.5.1 I get the same error. Once I figure this out, I’ll post the solution. Just wanted other to know that something changed in R8.5