Article ID: 121667
Article Last Modified on 5/6/2003
MyLabel.Caption=Left$(MyLabel.Caption,Len(MyLabel.Caption)-1).
Option Explicit
Sub NormalForm ()
Dim MyRecordSource As String
Dim DataX As Integer, DataY As Integer, LabelX As Integer, _
LabelY As Integer
Dim MyForm As String, MyFormCreate As Form, MyLabel As _
Control, MyControl As Control
MyRecordSource = "Table1"
Set MyFormCreate = CreateForm("", "")
MyForm = MyFormCreate.Formname 'Use this line in version 1.1.
MyForm = MyFormCreate.Name 'Use this line in version 2.0.
MyFormCreate.RecordSource = MyRecordSource
LabelX = 100
LabelY = 100
DataX = 1000
DataY = 100
' Create unbound default-size text box in the detail section.
Set MyControl = CreateControl(MyForm, 109, 0, "", "", DataX, _
DataY)
' Create child label control for the text box.
Set MyLabel = CreateControl (MyForm, 100, 0, MyControl.Control_
name, "hello", LabelX, LabelY) 'Use this line in version 1.1.
Set MyLabel = CreateControl(MyForm, 100, 0, MyControl.Name, _
"hello", LabelX, LabelY) 'Use this line in version 2.0.
DoCmd Restore
End Sub
Keywords: kbbug kbusage KB121667