You can only use the CreateControl in design view. So let's say you have a form already created. You can create another form with a command button on it and place the following on the OnClick event:
Private Sub Command0_Click()
Dim ctl As Control
DoCmd.OpenForm "ListBox_Form2", acDesign
Set ctl = CreateControl("ListBox_Form2", acListBox, acDetail, , , 1500, 1500, 1800, 1500)
ctl.Name = "Pick Name"
ctl.Visible = True
ctl.RowSource = "Select distinct [middlename] from [Mailinglist] where [middlename] is not null;"
Set ctl = Nothing
DoCmd.OpenForm "ListBox_Form2"
End Sub
So, I have a form called "Listbox_Form" with a command button. When clicked, it opens another form called "Listbox_Form2" in design view, creates a listbox and populates it with the SQL statement, then opens the form in form view.
In the CreateControl statement, the numbers are the left, right, up, down position of the listbox in twips. There are 1440 twips per inch.