"The OpenForm command was canceled"
Run-time error no. 2501
I gather from searching this and other forums that this is often a difficult error to pin down but maybe someone can help. I am opening a new form from a subform. The following works ok but means opening the whole recordset and moving to the one I want:
DoCmd.OpenForm "frmClientPODetail", OpenArgs:=Me.PONo
What I really want to do this:
DoCmd.OpenForm "frmClientPODetail", WhereCondition:="PONo = " & Me.PONo
but this give the error above. Debugging shows that the error is generated in executing the OpenForm line itself, not in trying to open the new form.