Ive created a form using vba and I have used the createControl function to add a button to the form.
I want to include code in the button creation which specifies what I would like to happen when the button is pressed (run an sql insert )
How can I achieve this?
button code:
I want to include code in the button creation which specifies what I would like to happen when the button is pressed (run an sql insert )
How can I achieve this?
button code:
Code:
Set ctlNew = CreateControl(frm.Name, acCommandButton, , , "newButton", 500, 500)
' Set control's caption.
ctlNew.Caption = "New Command Button"
With ctlNew
.Name = "niceNewButton"
End With