Filtering a report linked to a single record in a form

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
 
J

Jeff Boyce

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.
 
G

Guest

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?
 
J

Jeff Boyce

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.
 
G

Guest

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.
 

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