Article ID: 200593
Article Last Modified on 10/11/2006
Option Explicit
Sub SetDefaultProperties()
Dim frm As Form
Dim ctl As Control
Set frm = CreateForm()
Set ctl = frm.DefaultControl(acTextBox)
With ctl
' Add a label for new textboxes.
.AutoLabel = True
' Do not include a colon in labels for new textboxes.
.AddColon = False
' Align label text to the right for new textboxes.
.LabelAlign = 3
' Place labels for new textboxes 1/4 inch above
' and aligned to the left.
.LabelX = 1440 * .33
.LabelY = -1440 * .25
' Center text in new textboxes.
.TextAlign = 2
End With
DoCmd.SelectObject acForm, frm.Name, False
DoCmd.Restore
End Sub
SetDefaultProperties
Keywords: kbhowto kbprogramming KB200593