Creating Command Buttons On The Fly

P

panzer.guy

I have a field in a table containing names, let's say Tom, Bob, Sally,
and Jane. When the access (2000) file is opened, a form is
displayed. When this form is opened, I would like to have a command
button created for each person in the name field. So, in this
example, the form would open showing four command buttons that are
automatically generated displaying Tom, Bob, Sally, and Jane. When
one of the command buttons is clicked, another form opens which allows
the user to run a query based on the name from the command button.

So, I have two questions:
1) How do you automatically create command buttons from data in a
field?
2) How do you save that name for later use in a query?

Thanks in advance.
 
R

Rick Brandt

I have a field in a table containing names, let's say Tom, Bob, Sally,
and Jane. When the access (2000) file is opened, a form is displayed.
When this form is opened, I would like to have a command button created
for each person in the name field. So, in this example, the form would
open showing four command buttons that are automatically generated
displaying Tom, Bob, Sally, and Jane. When one of the command buttons
is clicked, another form opens which allows the user to run a query
based on the name from the command button.

So, I have two questions:
1) How do you automatically create command buttons from data in a field?
2) How do you save that name for later use in a query?

Thanks in advance.

Abandon this idea. Access forms have a life-time limit of controls that
can be added and you would quickly hit that. Other platforms add GUI
objects at runtime, but that is just not done with Access.

If there is a worst-case definition the usual work-around is to add as
many buttons as you will possibly need at one time into the desing of the
form and selectively hide/show them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top