JustinP said:
I'm try to call a sub in a subform from the mainform like this:
Forms![MainForm].Form![subform].Form![control in subform].name of sub
e.g. Forms![Property].Form![subfrmEase].Form![txtEase1].UpdateEnc
But it doesn't seem to work. Any ideas?
Two things:
1. The Sub in question must be declared as Public. It defaults to
Private.
2. I don't see why you are introducing the control "txtEase1", which I
assume is a text box. All code in the subform belongs to the form
module itself, not to the control.
So make sure your sub is declared as Public; e.g.,
Public Sub UpdateEnc()
And call it like this:
Forms![Property].Form![subfrmEase].Form.UpdateEnc
Or, if you're making the call from the main form ("Property") itself,
like this:
Me!subfrmEase].Form.UpdateEnc
Incidentally, in case you haven't discovered it already, "Property" is
not a good name for any object. Because it's a reserved word, it can
easily be misinterpreted by Access, and you have to be careful how you
refer to any object with that name.