Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using MS Access 2010.

I have a form with a number of fields of various types (number, text, lookup, checkbox).

Users can right click on any field to filter the form.

Then I have a button that generates a report based on this filtered data:

Private Sub Filter_and_Report_Click()
Dim strWhere As String
If Me.Dirty Then Me.Dirty = False
If Me.FilterOn Then strWhere = Me.Filter
DoCmd.OpenReport "WallsRpt", acViewPreview, , strWhere
End Sub

My question is how to list the fields that were filtered in the report (probably in the header/footer).

share|improve this question

The Filter condition is in Me.Filter: you use it above.

You'd have to parse this, but you must have set it previously to be able to apply it. Ignoring SQL Injection risk (I just got this off the interwebs), you know in this snippet you are filtering on ProductCatID

Me.Filter = "ProductCatID = """ & Me.cboShowCat & """"
Me.FilterOn = True

You can set a new variable/property (eg Me.Tag) for use in the Header/Footer

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.