Error 2465 with subform naming convention!

Martyh

Registered User.
Local time
Today, 19:44
Joined
May 2, 2000
Messages
196
I've searched and experimented, but to no avail...

On a form (frmWorkOrder) , I want to “call “ a property on a subform (Named sfrmDocument). In order to disable that subform.

Thus far I’ve narrowed the error to:

Me!sfrmDocument.Form.Enabled = False
Me!sfrmDocument.Form.Locked = False


This seems to be the way that http://www.mvps.org/access/forms/frm0031.htm would handle it. Someone's suggestion and it seemed to work before ...

Maybe I’m reading it wrong!! At any rate, I get the error 2465 Application defined or object defined error.

Am I forgetting something ? Help!!
 
I may be absolutely incorrect but I don't think you use the 'me.' in front of the form you are calling.

The 'me.' should be used when referencing an object on your current form. Exp. me.txtExample.lock = true. That text box would be located on your current form, not on another.
 
Thanks for the quick reply, but I've tried both with and Without the Me! and there seems to be no difference.

Actually I am calling this from the so-called parent form: ie from a code module within the form 'frmWorkOrder'

Marty:(
 
Martyh said:
I've searched and experimented, but to no avail...

On a form (frmWorkOrder) , I want to “call “ a property on a subform (Named sfrmDocument). In order to disable that subform.

Thus far I’ve narrowed the error to:

Me!sfrmDocument.Form.Enabled = False
Me!sfrmDocument.Form.Locked = False


This seems to be the way that http://www.mvps.org/access/forms/frm0031.htm would handle it. Someone's suggestion and it seemed to work before ...

Maybe I’m reading it wrong!! At any rate, I get the error 2465 Application defined or object defined error.

Am I forgetting something ? Help!!

I looked at your link, and all the examples are for controls on your subform. Not for the subform itself. I am not sure but there an enable or lock property of the form? Why not just hide the subform, that way it can't be used? Am I understanding you correctly as to what you are wanting done.
 
Actually, I've just experimented even further and found the solution:

Me!sfrmDocument.Enabled = False etc. It's that easy !!

I really don't know how to read that table that I quoted, and that was my problem! (and I thought that I had already tested that option....)

Does this show my embarassment?

:o
 

Users who are viewing this thread

Back
Top Bottom