How to keep subforms "attached" to main form field.

H

hdharrison

I am trying to make my form and subform consistant with the data in the
field in the main form. Here is what I mean.

Main Form

Department: Marketing

Subform

Name Department Position Hired Reports to
First Last Name Marketing V.P. Date CEO
....
....
First Last Name Marketing Admin Asst Date V.P.


I am trying to consolidate all of the people within a department so that I
can look it up fast. I also wanted to be able to Click on the department
and it would automatically find the ones that belongs to a certain
department.

I hope that makes sense here.

I am not that knowledgable with the VB coding but if given the basics I can
grasp the logic of it. So any suggestions or helpful tips that I can use to
make it user friendly. Thanks

Dustin
 
D

Dirk Goldgar

hdharrison said:
I am trying to make my form and subform consistant with the data in
the field in the main form. Here is what I mean.

Main Form

Department: Marketing

Subform

Name Department Position Hired
Reports to First Last Name Marketing V.P. Date
CEO ...
...
First Last Name Marketing Admin Asst Date V.P.


I am trying to consolidate all of the people within a department so
that I can look it up fast. I also wanted to be able to Click on the
department and it would automatically find the ones that belongs to a
certain department.

I hope that makes sense here.

I am not that knowledgable with the VB coding but if given the basics
I can grasp the logic of it. So any suggestions or helpful tips that
I can use to make it user friendly. Thanks

Dustin

If I understand you correctly, you're asking about something that Access
will do for you automatically, if you set the Link Master Fields and
Link Child Fields properties of the subform control correctly. In your
example above, it appears that you want the subform to show all records
for the same department as is current on the main form. To do that,
just set the Link Child Fields property of the subform control (on the
Data tab of its property sheet) to the Department field on the subform,
and the Link Master Fields property to the Department field on the main
form.

Note that the Link Master Fields may be a bound or unbound control, so
you can use an unbound list box or combo box as a "selector" control to
choose the department to be shown on the subform.
 
H

hdharrison

I tried using your suggestions and it worked to my expectations, Just
didn't know where to find it. Thanks for your help. As I am working
towards a goal to complete this, I am sure that I will run into a wall with
something that I can't figure out. So with that in mind I will be back to
ask questions and suggestions for any problems that I may have. I applause
to those who are more knowledgable and are willing to throw in their 2 cents
worth.
 

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