Report based on a new record doesn't display record

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

Guest

I have created a report with a linked subreport based on a form with a linked
subform.

When I add a new record to the main form and a new record to the subform and
print the report based on the main form record it displays the last record in
my table and not the new one.

When I close the form, re-open it, and print the report, it displays the
proper record and subrecords.

My initial thought was that it is an autonumber issue, but I am not sure
what I can do to resolve it. I have tested adding Save, Requery, and Refresh
statements before my OpenReport statement, but I still have the same result.

While the close and reopen work around fixes it, it is not what I would like
for the final product.

Any suggestions on would be greatly appreciated.
 
Refresh should do it, but perhaps you are refreshing the main form when you
need to refresh the subform?

If the button that prints the report is on the main form, and you are using
Me.Refresh, try Me!NameOfSubformContol.Form.Refresh instead.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top