Print filtered record to a report - error

  • Thread starter Thread starter k.roberts
  • Start date Start date
K

k.roberts

Have used the following code on a filtered record to print to a
report:-

It worked how I needed it to but I have a further query. Bit of
background info: I have 2 forms on my database to be filled in by
users, info stored in 2 separate tables (for a good reason). The
report that I am using to print the records to is the same for both
however. I use a filter on the record and then a print button to send
the record to the report - this works fine on the data from one form,
but when using the print button on the other, no data is pulled through
- the report stays blank. Do you have any idea why this might happen?
 
Which table is the RecordSource of the report?

If the report is bound to table A, but the form is getting records from
table B, there might not be any such record in table A for the report to
find.
 
Hi, I have checked the record source, and yes, it was set to the wrong
table. So I have made the amendment, press the print button and a
message box comes up prompting me to Enter Parameter Value - press OK
without entering data and the report is displayed with the correct
record, press cancel and I get the run debug error message!!
 
The request for a parameter means there is some name that does not match the
name of a field.

So you are looking for some place where you have the wrong field name, or a
misspelling, or perhaps you left the field out of the query and tried to use
it in the report.

If the problem is in the query, it will show up when you run the query
directly from the Database window.

If the problem is in the report, it could be in the Control Source of any
control, in the Sorting And Grouping dialog (View menu), in the Filter or
OrderBy properties of the report, etc. Hunt it down.
 
Back
Top