"Nested" Forms

T

thefonz37

I'm not sure if Nested is the right word for it, but here's my situation:

I have two tables. One of basic employee information and one of expanded
login information for our various order-processing systems. These tables are
related by employee ID, but the relationship is many-to-one, meaning that for
each "tblEmployeeInfo" record there are multiple "tblEmployeeLogin" records.

I created a form that displays the basic employee data from the
tblEmployeeInfo table and then has a subform with the tblEmployeeLogin
records, which is very nice. However, I would like to make it easier to
navigate the list of employee names, so I was considering creating a third
form with a listbox that would use my existing form and it's subform would
sit next to. So, when finished, you could click on a name in the listbox and
both subforms would populate.

Is it possible to "nest" them like this or would I be better off starting
over and having the listbox link to two child subforms instead of linking it
to one and then having that subform link to a subform?
 
K

Klatuu

You don't really have a many to many. It is, in fact, a one to many. An
example of a many to many is students and classes.
One student may attend 0 to many classes.
A class may have 0 to many students.
Since many to many relationships are not directly possible, you use a
junction table to resolve the many to many. That would be a table that
contains an entry for each class/student combination.

In your case, one employee may have many logins, but a login belongs to only
one employee. So it is a one to many.

But, that asside, you are on the right track with the form/subform
construct. It would, however, complicate your world to add an additional
form.

I would suggest putting your list box on the main form. But, actually, I
would suggest using an unbound combo box to select an employee. It doesn't
take up as much form space as a list box, but it is a very useful way to
select a different record. If you need some assistance with exactly how to
do that, post back and I will be happy to help. It would be helpfult to know
the name of the combo box, the primary key field name and data type of the
employee table's primary key field, and the name of the field or fields that
has the employee name.
 

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