Pooya wrote:
I have found out using this newsgroup how to use "Typeof" command in
an expression in order to identify certain type controls, howver is
there a similar function for control name rather than type?
<aircode>
function fListControlName(f as Access.form, strStart as string)
'f is an OPEN form in design, datasheet or form view
'strStart is the start of the control name you are looking for
'used inb the debug window
'To find control names beginning with "Oooga", on debug window type
' fListControlName(forms!frmMyForm, "Oooga")
dim c as Access.control
dim intL as integer 'length of strStart
intL = len(strStart)
for each c in f.controls
if left(c.name,intl) = strStart then debug.print c.name
next
end function
You can adapt the above as necessary for your purposes.
--
Tim
http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me