This article was previously published under Q200593
Advanced: Requires expert coding, interoperability, and multiuser skills.
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.
View products that this article applies to.
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
Keywords: KB200593, kbprogramming, kbhowto