I am trying to make a global function that will let me know if specific text boxes are filled out in the form. I originally write the function on the form I was working on and so I was using syntax like:
Me.Controls(TextBoxName).text
However, when I put the function in a code module, the function can't deal with the whole "Me.something" syntax. I am trying to pass in the form name, but I get the error "Invalid qualifier" when I use the syntax: FormName + dot + something. This is because "FormName" is a string and not referring to the actual form itself.
I know I can use the following syntax and I'm wondering if there is anything like it that will help me out. Any ideas? Thanks!
frmMyForm.Controls(stringname).Text
Me.Controls(TextBoxName).text
However, when I put the function in a code module, the function can't deal with the whole "Me.something" syntax. I am trying to pass in the form name, but I get the error "Invalid qualifier" when I use the syntax: FormName + dot + something. This is because "FormName" is a string and not referring to the actual form itself.
I know I can use the following syntax and I'm wondering if there is anything like it that will help me out. Any ideas? Thanks!
frmMyForm.Controls(stringname).Text