You can (should be able to) skip the with statement and use what you have and still check for zero length (not a null value).
Code:
Public Property Set ctl(ByVal vNewValue As TextBox)
if len(trim(vnewvalue)) > 0 then
Set mCtl = vNewValue
mCtl.OnDblClick = "[Event Procedure]"
mCtl.OnClick = "[Event Procedure]"
'.... the remainder of your code in here
endif
If instead you want to cycle through controls on a form you can do
Code:
Public Function CycleThrough(sformname)
dim ctl as control
for each ctl in forms(sformname).controls
'debug.print ctl.name
'note the above debug will list *all* controls
'typically I will use the TAG property to create subsets of controls I care about i.e. DE in the TAG property for data entry fields so you can do something like
if instr(ctl.tag, "DE") then
debug.print "data entry field: " & ctl.name
endif
next ctl
As a side note, I tend to write functions and write them as generically as possible so for instance if I have a form named table tblEmployees, the form relating to data entry is frmEmployees, and if I have a command button open that form it's named cmdEmployees, so in the 'on click' event of the button I can have some generic code like docmd.openform replace(screen.activecontrol.name, "cmd", "frm") that works regardless of which button I attach it to. If you have a form with a ton of controls that all have similar functions I would attempt to economize your code with functions rather than having the same code repeated across controls