skull_eagle
Board Regular
- Joined
- Mar 25, 2011
- Messages
- 89
Hi,
I'm struggling with this one.
I'm adding new command buttons to my userform based on a search. I don't know how many command buttons will be created each time.
I need to identify which button the user is clicking so I can use that button name as a variable.
I'm struggling with this one.
I'm adding new command buttons to my userform based on a search. I don't know how many command buttons will be created each time.
I need to identify which button the user is clicking so I can use that button name as a variable.
VBA Code:
Set NewBt = SearchForm.Controls.Add("Forms.CommandButton.1", cl, True)
With NewBt
.Top = 70 + (sCount * 22)
.Left = 472
.Height = 18
.Width = 18
.Visible = True
.Font.Size = 11
.Caption = "="
End With