Hallo zusammen.
Ich generiere über folgenden Code einen CommandButton in einem Formular.
Dim cmdBox As MSForms.CommandButton
Dim x as Integer
fieldInfo = x & "\_edit"
Set cmdBox = Me.Controls.Add("Forms.CommandButton.1", "cmd" & fieldInfo, True)
cmdBox.Caption = "Ändern"
cmdBox.Left = 210
cmdBox.Top = topPosition
cmdBox.Height = 20
cmdBox.Width = 60
Das funktioniert auch einwandfrei.
Nun möchte ich diesem CommandButton das Click-Event anhängen, zB, dass bei Click auf den Button, die Function ModLine(x,„edit“) ausgeführt wird.
Ich habe schon einiges versucht, jedoch ohne Erfolg.
Könnt ihr mir weiterhelfen?
Danke.
Beste Grüße,
Sebastian