How can i add macros into form which I had created through VBA

pjustin1

Registered User.
Local time
Today, 14:54
Joined
Nov 9, 2001
Messages
15
Hi,

I create a form through VBA, using the code I shown below.. How can I set macros which I had created earlier into the events properties of the textboxes and commmand button too?

Thanks..

Set ctlText = CreateControl(frm.Name, acTextBox, , "", "", _
intDataX, intDataY)

Set ctlLabel = CreateControl(frm.Name, acLabel, , ctlText.Name, _
"BookTitle", intLabelX, intLabelY)

Set ctlText = CreateControl(frm.Name, acTextBox, , "", "RetailPrice",intDataX, intDataY + 500)

Set ctlLabel = CreateControl(frm.Name, acLabel, , ctlText.Name, _
"Retail Price", intLabelX, intLabelY + 500)

Set ctlButton = CreateControl(frm.Name, acCommandButton, , "", "", intLabelX, intLabelY + 1000)
 

Users who are viewing this thread

Back
Top Bottom