I'm using this code straight from the box. Only thing is this is a MDI child.

VB Code:
  1. Option Explicit
  2.  
  3. Dim WithEvents cmdButton As CommandButton
  4.  
  5. Private Sub cmdButton_Click()
  6.     MsgBox "hi"
  7. End Sub
  8.  
  9.  
  10. Private Sub Form_Load()
  11.      
  12.     Set cmdButton = Me.Controls.Add("VB.CommandButton", "newCommandButton")
  13.      
  14.     With cmbButton
  15.         .Left = 1000
  16.         .Top = 1000
  17.         .Width = 2000
  18.         .Height = 500
  19.         .Caption = "Hello"
  20.         .Visible = True
  21.     End With
  22.  
  23. End Sub
  24.  
  25. Private Sub Form_Unload(Cancel As Integer)
  26.     Set cmdButton = Nothing
  27. End Sub

It is highlighting the Form Load Procedure. I see nothing wrong with this code. I've tried tinkering with it only to make it worse.. Any Help appreciated. I'm looking for a dynamic way to create toolbar items.