synchronizing a form & report

  • Thread starter Thread starter JD
  • Start date Start date
J

JD

While in a form adding info to the fields I want to open a
report in such a way that it displays or prints a form's
current record. As it is written below it only opens a
report with no information in any of the fields.

I'm using auto number for the id field

Private Sub Command68_Click()
If Forms![FORMleadsheet].Dirty = True Then Forms!
[FORMleadsheet].Dirty = False
DoCmd.OpenReport "RPTactiveleadsheet",
acViewPreview, , "[Customer ID]=Forms![FORMleadsheet]!
[Customer ID]"
End Sub
 
Hi,

I have a similar function in one of my forms. the way I
got around it was i wrote a "criteria query" that filters
the report to the specified record I want printed. before
the report is printed, I opened a "control form" in
dialog mode, and called the report from there. After
printing, the "control form" is closed and the record I
am editing remains open on the origional form.

If you try that and the report still prints blank, try
saving the record before opening the "control form" that
prints the report.

For the "criteria query", you could use a hidden checkbox
control on the origional form to specify the record(s)
you are attempting to print reports for.

please let me know if you find a more efficient way of
doing this.

Sam.
 
Back
Top