I'm trying to write a generic Sub to build up a string of all the data I've typed into my text boxes, combos, etc since I last did a Save.
Most of my controls are held within user controls, so I'd like to call my new Sub like this -
sChangeString = GetChangeString (Me)
I've created my Sub within a module like this -
Public Sub GetChangeString(ByRef myCtl As Variant)
Inside my Sub I wanted to loop through the controls collection within myCtl to build up a text string of their values. However, when I try to access any of my constituent controls I get Run time error 438 - Object doesn't support this property or method. I can't even access the name of the controls, e.g. myCtl.Controls(1).Name
Strangely though, I can see any properties of my User Control that have a Public Get by doing myCtl.myID where myID is a public property.
I'd be very grateful if anyone could tell me where I'm going wrong, or suggest a better way to do this.
Thanks in advance.
Most of my controls are held within user controls, so I'd like to call my new Sub like this -
sChangeString = GetChangeString (Me)
I've created my Sub within a module like this -
Public Sub GetChangeString(ByRef myCtl As Variant)
Inside my Sub I wanted to loop through the controls collection within myCtl to build up a text string of their values. However, when I try to access any of my constituent controls I get Run time error 438 - Object doesn't support this property or method. I can't even access the name of the controls, e.g. myCtl.Controls(1).Name
Strangely though, I can see any properties of my User Control that have a Public Get by doing myCtl.myID where myID is a public property.
I'd be very grateful if anyone could tell me where I'm going wrong, or suggest a better way to do this.
Thanks in advance.