Quote:
Originally posted by Thomas Halsvik
know how to create one. But deleting is harder. Can't find example code on it anywhere. Topic is little known probably.
Dim MyCmd As Control
Set MyCmd = Controls.Add("Forms.CommandButton.1","<Control Name>")
MyCmd.left = 18
MyCmd.top = 50
MyCmd.width = 175
MyCmd.height = 20
MyCmd.Caption = "This iz fun. " & MyCmd.Name
I've tried
MyCmd.Delete
but only get an error 91.
Anyone know the answer?
I think you need to assign a name to the newly created CommandButton, else you can not remove the control with the