How do I turn on a filter in a subform?

  • Thread starter Thread starter super_dave_42
  • Start date Start date
S

super_dave_42

I am self-taught with MS Access, so forgive me if this seems too
idiotic.

I am trying to create a "game" for my niece so that she can practice
her basic math skills. I have created a form and VB code to run the
flashcards and keep track of her time ( there are sites on the web that
have flashcards but I have yet to find one that allows me to track her
progress, esp. if the cookies are disabled).

My trouble is creating a form to display the results. I have 3
different difficulty levels and I would like to display the top 5
scores from each category in a separate list. I have just one table
containing all the scores and a field called 'Difficulty' stores a code
in each record to keep them sorted.

I don't need to edit any data on my main form, just display the 3 lists
and give a "Begin" button. I thought that I might be able to create a
subform that uses only the datasheet view and just use a filter to
display each of my difficulty lists on my main form. Is this possible?
If so, how do I set it up? Will I have issues with refreshing the data
in the subform views?

Thanks in advance for any advice. Hopefully with your help I can finish
this before the little whipper-snapper starts college. lol
 
To change the filter for a subform, you use something like:

Me!SubformContainer.Form.Filter = "[Difficulty] = 2"
Me!SubformContainer.Form.FilterOn = True

Note that SubformContainer is the name of the control on the main form that
holds the subform. That may or may not be the same name as the form that's
being used as a subform. If you create the subform by dragging one form onto
another form, the names should be the same. However, if you create the
subform by adding a subform container from the tool bar onto your main form
and then providing the necessary information (either manually or through the
wizard), the container will usually be named something like Child0.
 
Back
Top