I have figured out how to create command buttons and have tried to change their general color, but to no avail. This is what I tried, but it did nothing:
Option Explicit Dim WithEvents Com As CommandButton Private Sub Form_Load() Set Com = Me.Controls.Add("vb.commandbutton", "BtnName") With Com .Left = 100 .Top = 100 .Width = 2000 .Height = 500 .Visible = True .Caption = "Student 1" .DragMode = 0 End With End Sub Private Sub Com_click() Com.BackColor = &HFF& End Sub
It runs but does nothing. any help would be very much appreciated.