<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VBA%2FExcel%2FAccess%2FWord%2FForms%2FForm_Control</id>
		<title>VBA/Excel/Access/Word/Forms/Form Control - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.vbex.ru/index.php?action=history&amp;feed=atom&amp;title=VBA%2FExcel%2FAccess%2FWord%2FForms%2FForm_Control"/>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VBA/Excel/Access/Word/Forms/Form_Control&amp;action=history"/>
		<updated>2026-04-05T08:07:01Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VBA/Excel/Access/Word/Forms/Form_Control&amp;diff=1911&amp;oldid=prev</id>
		<title> в 16:33, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VBA/Excel/Access/Word/Forms/Form_Control&amp;diff=1911&amp;oldid=prev"/>
				<updated>2010-05-26T16:33:00Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 16:33, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://www.vbex.ru/index.php?title=VBA/Excel/Access/Word/Forms/Form_Control&amp;diff=1912&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.vbex.ru/index.php?title=VBA/Excel/Access/Word/Forms/Form_Control&amp;diff=1912&amp;oldid=prev"/>
				<updated>2010-05-26T12:48:30Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==change control back ground color==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Sub Form_Current()&lt;br /&gt;
    Dim ctl as Control&lt;br /&gt;
    For Each ctl In Controls&lt;br /&gt;
        If TypeOf ctl Is TextBox Then&lt;br /&gt;
            If IsNull(ctl.Value) Then&lt;br /&gt;
                ctl.BackColor = vbCyan&lt;br /&gt;
            Else&lt;br /&gt;
                ctl.BackColor = vbWhite&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
    Next ctl&lt;br /&gt;
End Sub&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Change fonts of controls on a form==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    Sub FormFonts (strFont As String)&lt;br /&gt;
       Dim frmCurrent As Form&lt;br /&gt;
       Dim ctlControl As Control&lt;br /&gt;
    &lt;br /&gt;
       For Each frmCurrent In Forms&lt;br /&gt;
          For each ctlControl In frmCurrent.Controls&lt;br /&gt;
             ctlControl.FontName = strFont&lt;br /&gt;
          Next&lt;br /&gt;
        Next&lt;br /&gt;
     &lt;br /&gt;
     End Sub&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Controls and Errors==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
    Sub FormFonts(strFont As String)&lt;br /&gt;
       On Error GoTo FormFonts_Err&lt;br /&gt;
       Dim frmCurrent As Form&lt;br /&gt;
       Dim ctlControl As Control&lt;br /&gt;
    &lt;br /&gt;
       For Each frmCurrent In Forms&lt;br /&gt;
          For Each ctlControl In frmCurrent.Controls&lt;br /&gt;
             ctlControl.FontName = strFont&lt;br /&gt;
           Next&lt;br /&gt;
        Next&lt;br /&gt;
     &lt;br /&gt;
FormFonts_Exit:&lt;br /&gt;
        Exit Sub&lt;br /&gt;
     &lt;br /&gt;
FormFonts_Err:&lt;br /&gt;
        If Err.Number = 438 Then&lt;br /&gt;
           Resume Next&lt;br /&gt;
        Else&lt;br /&gt;
           MsgBox Err.Description&lt;br /&gt;
           Resume FormFonts_Exit&lt;br /&gt;
        End If&lt;br /&gt;
End Sub&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Control Types==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Sub main()&lt;br /&gt;
   For Each frmCurrent In Forms&lt;br /&gt;
      For Each ctlControl In frmCurrent.Controls&lt;br /&gt;
         If ctlControl.Type &amp;lt;&amp;gt; acCheckBox Then&lt;br /&gt;
            ctlControl.font = strFont&lt;br /&gt;
         End If&lt;br /&gt;
      Next&lt;br /&gt;
   Next&lt;br /&gt;
End Sub&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Determining the Type of a Control==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Sub FlipEnabled(frmAny As Form, ctlAny As Control)&lt;br /&gt;
    Dim ctl As Control&lt;br /&gt;
    ctlAny.Enabled = True&lt;br /&gt;
    ctlAny.SetFocus&lt;br /&gt;
    For Each ctl In frmAny.Controls&lt;br /&gt;
        If ctl.ControlType = acCommandButton Then&lt;br /&gt;
            If ctl.Name &amp;lt;&amp;gt; ctlAny.Name Then&lt;br /&gt;
                ctl.Enabled = Not ctl.Enabled&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
    Next ctl&lt;br /&gt;
End Sub&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Intrinsic Constant Type of Control==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
acLabel             Label&lt;br /&gt;
acRectangle         Rectangle&lt;br /&gt;
acLine              Line&lt;br /&gt;
acImage             Image&lt;br /&gt;
acCommandButton     Command button&lt;br /&gt;
acOptionButton      Option button&lt;br /&gt;
acCheckBox          Check box&lt;br /&gt;
acOptionGroup       Option group&lt;br /&gt;
acBoundObjectFrame  Bound object frame&lt;br /&gt;
acTextBox           Text box&lt;br /&gt;
acListBox           List box&lt;br /&gt;
acComboBox          Combo box&lt;br /&gt;
acSubform           Subform/subreport&lt;br /&gt;
acObjectFrame       Unbound object frame or chart&lt;br /&gt;
acPageBreak         Page break&lt;br /&gt;
acPage              Page&lt;br /&gt;
acCustomControl     ActiveX (custom) control&lt;br /&gt;
acToggleButton      Toggle button&lt;br /&gt;
acTabCtl            Tab&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Manipulating a Single Control==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Sub FormCaptions()&lt;br /&gt;
    Dim frm As Form&lt;br /&gt;
    For Each frm In Forms&lt;br /&gt;
        frm.Caption = frm.Caption &amp;amp; &amp;quot; - &amp;quot; &amp;amp; CurrentUser&lt;br /&gt;
    Next frm&lt;br /&gt;
End Sub&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The For Each...Next statement executes a group of statements on each member of an array or collection==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Private Sub cmdForEachNext_Click()&lt;br /&gt;
    Dim ctl As Control&lt;br /&gt;
    For Each ctl In Controls&lt;br /&gt;
        ctl.FontSize = 8&lt;br /&gt;
    Next ctl&lt;br /&gt;
End Sub&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The With...End With statement executes a series of statements on a single object or user-defined type==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Private Sub cmdWithEndWith_Click()&lt;br /&gt;
   With Me.txtAge &amp;quot; Your Text Field&amp;quot;s name&lt;br /&gt;
      .BackColor = 16777088&lt;br /&gt;
      .ForeColor = 16711680&lt;br /&gt;
      .Value = &amp;quot;Hello World&amp;quot;&lt;br /&gt;
      .FontName = &amp;quot;Arial&amp;quot;&lt;br /&gt;
   End With&lt;br /&gt;
End Sub&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==With...End With construct is often used along with the For Each...Next construct==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;vb&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Private Sub cmdForEachWith_Click()&lt;br /&gt;
    Dim ctl As Control&lt;br /&gt;
    For Each ctl In Controls&lt;br /&gt;
        With ctl&lt;br /&gt;
            .ForeColor = 16711680&lt;br /&gt;
            .FontName = &amp;quot;Arial&amp;quot;&lt;br /&gt;
            .FontSize = 14&lt;br /&gt;
        End With&lt;br /&gt;
    Next ctl&lt;br /&gt;
End Sub&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>