<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE>@page Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 6pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 6pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 6pt; FONT-FAMILY: "Times New Roman"
}
H2 {
FONT-SIZE: 14pt; MARGIN: 12pt 0cm 3pt; FONT-STYLE: italic; FONT-FAMILY: Arial
}
H3 {
FONT-SIZE: 13pt; MARGIN: 12pt 0cm 3pt; FONT-FAMILY: Arial
}
H4 {
FONT-SIZE: 12pt; MARGIN: 3pt 0cm; FONT-FAMILY: Arial
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline
}
P.Code {
FONT-SIZE: 12pt; MARGIN: 6pt 0cm 6pt 17.85pt; FONT-FAMILY: "Courier New"; punctuation-wrap: simple
}
LI.Code {
FONT-SIZE: 12pt; MARGIN: 6pt 0cm 6pt 17.85pt; FONT-FAMILY: "Courier New"; punctuation-wrap: simple
}
DIV.Code {
FONT-SIZE: 12pt; MARGIN: 6pt 0cm 6pt 17.85pt; FONT-FAMILY: "Courier New"; punctuation-wrap: simple
}
SPAN.EmailStyle18 {
COLOR: windowtext; FONT-FAMILY: Arial
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV><SPAN class=569483817-09032003><FONT face=Arial color=#0000ff size=2>Works
fine in A97 dimming frm as Form and setting it to Me withing a form
module. Could the AllForms collection be returning something other than a
Form object? Try wrapping your For...Next in an If...TypeOf block to see
if you can weed out "bad" object references.</FONT></SPAN></DIV>
<DIV><SPAN class=569483817-09032003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=569483817-09032003><FONT face=Arial color=#0000ff
size=2>HTH,</FONT></SPAN></DIV>
<DIV><SPAN class=569483817-09032003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=569483817-09032003><FONT face=Arial color=#0000ff size=2>Jim
DeMarco (what am I doing working on a Sunday?)</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Arthur Fuller
[mailto:artful@rogers.com]<BR><B>Sent:</B> Sunday, March 09, 2003 10:03 AM<BR><B>To:</B> AccessD<BR><B>Subject:</B> [AccessD] Iterating
Controls<BR><BR></FONT></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Here’s a little snippet from some
code I’m writing:</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><code></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> 'Walk through
forms</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> For Each Frm In
db.AllForms</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
DoCmd.OpenForm Frm.name, acDesign</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
a.WriteLine "Form: " & Frm.name</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
'Walk through controls</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
For Each ctl In Frm.Controls</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
With ctl</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></code></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The code errors on the second last
line, complaining that “object doesn’t support this property or method”.
What’s the right way to reference the collection of controls on a form and
then walk the collection? </SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I’m still hunting as I write this,
so I may post my own reply…</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">TIA,</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Arthur</SPAN></FONT></P></DIV></BLOCKQUOTE><CODE><FONT SIZE=3><BR>
<BR>
***********************************************************************************<BR>
"This electronic message is intended to be for the use only of the named recipient, and may contain information from HealthSource/Hudson Health Plan (HS/HHP) that is confidential or privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this message is strictly prohibited. If you have received this message in error or are not the named recipient, please notify us immediately, either by contacting the sender at the electronic mail address noted above or calling HS/HHP at (914) 631-1611. If you are not the intended recipient, please do not forward this email to anyone, and delete and destroy all copies of this message. Thank You".<BR>
***********************************************************************************<BR>
</FONT></CODE>
</BODY></HTML>