no data on report (1 Viewer)

kobiashi

Registered User.
Local time
Today, 19:01
Joined
May 11, 2018
Messages
258
hi

im not quite sure where to post this one, so i thought i'd start here.

so i have a form that have a number of sub forms in it, the form is not bound to a query, so the sub forms are not linked by parent, child. The data is appended to a table, through an append query, which works fine, on this form there is an email button, to email a report with the data from the form, when I open the report and view it, all the data is present, but when i send it via email in PDF format, there is no data, the control source is present, but the data inside is empty, i have checked the sub forms, and there is data in the sub forms, plus i have also tried to apply another sub form, which has data into that particular sub form, and sent it via email from the same button, which i can view and the data is present in the report PDF.

this is totally baffling me, so does anyone have any suggestions as to what could be possibly causing this, or where i should start looking?
 

isladogs

MVP / VIP
Local time
Today, 19:01
Joined
Jan 14, 2017
Messages
18,211
Presumably the data refers to your form and that is still open when you view the report.
However, when the PDF is created the data source is disconnected from the form.
This can also happen when a report is printed as distinct from print preview.

It's difficult to give a precise solution based on the info provided.

Can you create your PDF from the form instead or modify the report data source to sidestep the issue e.g. use variables or functions??
 

kobiashi

Registered User.
Local time
Today, 19:01
Joined
May 11, 2018
Messages
258
Presumably the data refers to your form and that is still open when you view the report.
However, when the PDF is created the data source is disconnected from the form.
This can also happen when a report is printed as distinct from print preview.

It's difficult to give a precise solution based on the info provided.

Can you create your PDF from the form instead or modify the report data source to sidestep the issue e.g. use variables or functions??

hey

thanks for the advice, i thought i was onto something, when you mentioned about the form being open, so i created a report to display the data, and then email from the report, but still no joy, plus i set up a print preview button, and that also shows no data, can you explain to me what you meant by the data or report becoming disconnected upon being created into a PDF, that may be worth investigating.
 

kobiashi

Registered User.
Local time
Today, 19:01
Joined
May 11, 2018
Messages
258
so i think i have identified the cause for this, when there is no data in a sub form, it will not display on a report in print preview or pdf, it wont even display the headers of the sub form.
 

isladogs

MVP / VIP
Local time
Today, 19:01
Joined
Jan 14, 2017
Messages
18,211
That is correct.
You could add code to show a message in a normally hidden textbox placed where the subform normally appears.
It could say something like 'No data for this subreport'
 

Users who are viewing this thread

Top Bottom