Code for Opening Filtered Form

G

Guest

I have three tables-Personnel, Courses, Employee Courses Completed. I have
to track all the training completed by our employees. I made a relationship
that ties them all together. I made a query (Employee Courses Status) so
that I could have a single form (also called Employee Courses Status) that
they all get entered into. This became a problem because I need an infinite
number of training entries per employee. I then made a button on my form to
open another form that lists all the training for that individual. What do I
do to make it open the form to the person I am working on? If I am working
on someone with a last name of Smith, I don't want to have to scroll through
the entire training form to find that person.
 
W

Wayne Morgan

First, you could make the second form a subform of the first, linking the
two forms on the ID field for the person.

Another option would be to use the WHERE argument of the DoCmd.OpenForm call
when you open the other form.

DoCmd.OpenForm "OtherFormName",,,"[IDField]=" & Me.txtIDField

Use additional arguments as needed. The syntax above assumes the ID value to
be a number, if it is text, you'll need to concatenate quotes around it.
 

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