Create buttons programmatically?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How could I create command buttons programmatically and relate them to
different records?
My senior wants me to create a form that would have command buttons for each
of the records that are resulted based on some specific criteria.
say for eg. if I get 4 records based on some criteria, I should display 4
command buttons-cmdRecord1,cmdRecord2,cmdRecord3,cmdRecord4 on the form,
which on clicked should show appropriate record details.
 
Really Bad Idea!

First, there is a limit of about 770 controls for a form. (The number is
not exact, but I can't remember for sure). This does not mean currently
defined controls. It means each time you add a control, the count goes up by
one, but when you delete a control, it does not go down. So, after a few
runs of your form, it will quit working.

A better approach would be to have a subform where the minimal info you plan
to present for each record would be displayed. Then use one command button
to open a detail form for the current record in the sub form.
 
Klatuu,in my case there would not be more than 3 records for sure.(even 3
would be in extreme cases).
But I think your approach sounds better.
 
Back
Top