Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Sub NewControls()
Dim frm As Form
Dim ctlLabel As Control, ctlText As Control
Dim intDataX As Integer, intDataY As Integer
Dim intLabelX As Integer, intLabelY As Integer
' Create new form with Orders table as its record source.
Set frm = CreateForm
frm.RecordSource = "Orders"
' Set positioning values for new controls.
intLabelX = 100
intLabelY = 100
intDataX = 1000
intDataY = 100
' Create unbound default-size text box in detail section.
Set ctlText = CreateControl(frm.Name, acTextBox, , "", "", _
intDataX, intDataY)
' Create child label control for text box.
Set ctlLabel = CreateControl(frm.Name, acLabel, , _
ctlText.Name, "NewLabel", intLabelX, intLabelY)
' Restore form.
DoCmd.Restore
End Sub
'ADD CHECKBOX
Set ctlcheck(i) = _
CreateControl("frmDynamic", _
acCheckBox, , _
ctlViews.Pages(iFNo(i)).name, _
"chkcheckbox" & i, _
intDataX(iCheckCount(iFNo(i)), _
iFNo(i)) + 1, _
intDataY(iCheckCount(iFNo(i)), _
iFNo(i)) + 1)
With ctlcheck(i)
.name = szFieldNames(i, 0)
.ControlSource = ""
End With
'ADD LABLE
Set ctllable(i) = _
CreateControl("frmDynamic", _
acLabel, acDetail, _
ctlViews.Pages(iFNo(i)).name, _
"lblcheck" & i, _
intDataX(iCheckCount(iFNo(i)), _
iFNo(i)) + 200, _
intDataY(iCheckCount(iFNo(i)), _
iFNo(i)) - 40)
With ctllable(i)
.name = szFieldNames(i, 0) & "lbl"
.Caption = szFieldNames(i, 0)
.FontSize = 9
.SizeToFit
End With
iCheckCount(iFNo(i)) = iCheckCount(iFNo(i)) + 1
iRowCount(iFNo(i)) = iRowCount(iFNo(i)) + 1