Add Table to a report.

  • Thread starter Thread starter rphillips1
  • Start date Start date
R

rphillips1

I have a form that has a subform added to it. The main form is customer
information the subform is customer product data. I have a button that
I use to preview the customer information and product. I want to be
able to view only the customer information that I am viewing in the
form and subform not all customers and product. Can some suggest a way
to do this?
 
Your subject line doesn't seem to correspond to what you're asking, and so
I'm not sure exactly what you're wanting - particularly since your text
description mentions neither tables nor reports.

However, if what you have is a button which is opening a report in preview
mode, and you want to limit that report to the current record in the form,
then just include a Where parameter in the OpenReport statement, such as:

DoCmd.OpenReport "MyReportName", acViewPreview, , "CustomerID = " &
Me!CustomerID

Substitute the name of your key field for CustomerID if it is different; and
if it's a text string, rather than a number, you'll need single quote
delimiters, thus:

DoCmd.OpenReport "MyReportName", acViewPreview, , "CustomerID = '" &
Me!CustomerID & "'"

HTH,

Rob
 
Back
Top