Filtering a report linked to a single record in a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My database is for a food bank. I have a Client table (contact details etc)
and a linked ClientHistory table (date, food parcel details, budgeting
details...). If I open the Client form at Joe Smith, I want to be able to
click a command button that opens a ClientHistory report just for that name.
As an enthusiastic amateur I've tried a few filter commands but am basically
out of my depth.

PeterK
 
Peter

Check Access HELP for the syntax on DoCmd.OpenReport "ReportName",,,

One of those ","s marks the place for a filter/where clause that let's you
pass a clientID (for Joe) to the report.
 
Thanks Jeff for a prompt reply.
I've searched my Access HELP and DoCmd appears once in passing with no full
explanation or syntax. Do I need to go to a more complete HELP resource?
Online? If so, what's the best option?
 
Depends on which version of Access you are using.

One approach would be to open a code module (or code behind form), then use
VBA HELP for OpenReport.
 
I'm using Access 2002.

A trap for learners - I've discovered that not all my Access HELP files were
initially installed, so I've discovered a whole new resource!

My first response to your reply was, "what is a code module?" So I guess I
need to take time out for more reading, and come back with a specific query
when I'm hopefully further on.

Thanks for your help.
 
Back
Top