Applying a filter to the RecordSource of a Form

D

davecoats622

I have a form called (frmComments) whose recordsource is a table called
(tblComments). The tblComments table contains comments for multiple students
for mulitple examinations. When viewing the Form (frmComments), I need to
"filter" the recordsource so that I only see comments for the current
student. Can I utilize the "Filter" property in the Properties Sheet to
allow only comments pertaining to the current student to be seen? If so, I
have not been able to get the filter to work......it still shows all the
records for all the students. On the Property Sheet under Filter, I entered
"Me.StudentID = 8" which should return only records for student #8. Do you
know the correct format that should be used to enter this filter?
 
R

Rick Brandt

davecoats622 said:
I have a form called (frmComments) whose recordsource is a table
called (tblComments). The tblComments table contains comments for
multiple students for mulitple examinations. When viewing the Form
(frmComments), I need to "filter" the recordsource so that I only see
comments for the current student. Can I utilize the "Filter"
property in the Properties Sheet to allow only comments pertaining to
the current student to be seen? If so, I have not been able to get
the filter to work......it still shows all the records for all the
students. On the Property Sheet under Filter, I entered
"Me.StudentID = 8" which should return only records for student #8.
Do you know the correct format that should be used to enter this
filter?

Me.Filter = "StudentID = 8"
Me.FilterOn = True
 

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