View Single Post
  #2 (permalink)  
Old January 7th, 2004, 12:52 PM
fishypew fishypew is offline
Registered User
Join Date: Jan 2004
Location: , RI, .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts

I've got this working (not every detail, but basics)
You may have had trouble with specifying the name of
your form as String. I added a variable for form name.

Public Sub NewControls()

Dim frm As Form
Dim BtnTest As Control
Dim frmname As String

Set frm = CreateForm
frmname = frm.Name
frm.RecordSource = "tblCompany"
Set BtnTest = CreateControl(frmname, acCommandButton, , , , 100, 100, 100, 100)
DoCmd.OpenForm frmname, acNormal
End Sub

Reply With Quote