Dynamically Create/Move

S

SCary

I would like to be able to:
-- dynamically create controls (usually a text box) on a form in the Form
View (not the Design View) based on entries in a table (the contents of which
are managed by another form) in the the same Access database. Each of the
text boxes would, for example, represent nodes in a hierarchy.
-- dynamically create lines connecting those text boxes/hierarchy nodes
based on another table containing linking information about which nodes are
connected.
-- move those dynamically created text boxes around on the form in response
to mouse click events while the form is in the Form View mode.

Example: Suppose there is a company with two divisions. I would like to
create a three node hierarchy diagram. It would include a text box
containing the company name at the top and two text boxes containing the
division names underneath with lines going from the company text box to each
of the division boxes, but not between the division boxes. This drawing
would be based on two tables: 1) an ORGNAZATION table that contains a row for
each of these three organizations and 2) a LINK table that contains a row for
each of the two links between the company and divisions. The ORGNAZATION
table would at minimum include fields for each Organization's name and
coordinates on the form for where the correponding text box is located. The
LINK table would include at minimum fields for the name of the parent
organization and the name of the child organization in each relationship.

Is this possible? If so, how? If you have suggestions on how to accomplish
even part of this problem, please let me know. Some of the key components of
the solution include:
-- how to dynamically create new text boxes on the hierarchy diagram form
without putting it into the design view.
-- how to detect the X, Y mouse coordinates with respect to the underlying
form, when the cursor is over one of the controls on that form. When the
cursor moves over a control, at least the default behavior of the mouse move
event is to start giving coordinates in a system in which the upper left
corner of the control is (0,0) instead of the upper left corner of the form
being (0,0); reporting mouse coordinates in terms of the upper left corner of
the form being (0,0) only applies when the cursor is not over any control.

SCary
 
A

Allen Browne

SCary said:
I would like to be able to dynamically create controls (usually a text box)
on a form in the Form View (not the Design View)

No. That's not possible.
 
J

Jeff Boyce

Why? What will having dynamically-created controls (via Form View) allow
you to do?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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