Create command buttons using code

casey

Registered User.
Local time
Today, 16:05
Joined
Dec 5, 2000
Messages
448
Hello all,

Can someone give me direction on how to create command buttons by using VBA? I would like an interface where buttons are based on the values in the tables. I can access the tables with no problem, but I can't figure out how to create the buttons on the fly.

Any ideas or sites that show how this would be done?

Thanks.
 
I've tried the following code, but it gives me an error that MS-Access cannot add, delete, ...the control.

Can someone direct me to the Reference that I'm missing here?

code....
Dim cmdTest As Control

DoCmd.OpenForm "frmTest", acDesign
Set cmdTest = CreateControl("frmTest", acCommandButton, acDetail)
DoCmd.Restore
 
Last edited:

Users who are viewing this thread

Back
Top Bottom