Private Sub Command669_Click()
Dim report As String
report = "ID Report"
id = Forms("form").txtbox
DoCmd.OpenReport report, view:=acViewPreview, _
wherecondition:= Reports(report).subform.Form.Filter = "[ID] = '" & Me.id & "'", _
windowmode:=acHidden
DoCmd.OutputTo acOutputReport, report, acFormatPDF, , True
End Sub
First, let's verify... When you execute that code, it should open the report and leave it open (because I don't see where you're closing it). If so, review the report and let us know if the subform/subreport is actually filtered as you expected.It export the report without the filter. Is the code right?
Hmm, I may have answered my own question. It looks like you're still trying to figure out how to filter the subreport. Is that correct?First, let's verify... When you execute that code, it should open the report and leave it open (because I don't see where you're closing it). If so, review the report and let us know if the subform/subreport is actually filtered as you expected.
No, it is not the same situation. That's why I created two different threads...So, as asked in your other thread: Is the subform/subreport container control actually named "subform"? If not, then use the correct name.
Strongly advise not to use spaces nor punctuation/special characters in naming convention.
It is. I can make the way you like to do. Do you know a code that export a report with a filtered subform/subreport in it, please?Hmm, I may have answered my own question. It looks like you're still trying to figure out how to filter the subreport. Is that correct?
I didn't correct your original code, because I think it should work as is. So, we just need to make sure you are filtering the subreport properly. Once it is, the OutputTo should work fine. By the way, is the subreport using the Linked Master/Child Fields? If so, would filtering the main report not enough to also filter the subreport?It is. I can make the way you like to do. Do you know a code that export a report with a filtered subform/subreport in it, please?
You are not helping at all...
That helped me a lot. Thank you so much.I didn't correct your original code, because I think it should work as is. So, we just need to make sure you are filtering the subreport properly. Once it is, the OutputTo should work fine. By the way, is the subreport using the Linked Master/Child Fields? If so, would filtering the main report not enough to also filter the subreport
Hi. We were all happy to assist. Good luck with your project.That helped me a lot. Thank you so much.
Primarily, I was not talking to you.
......... The truth is that you and June7 are lacking so much knowledge and having so much arrogance that, by the moment you truly believe you understood the situation, you start questioning my code with ridiculous points (which shows your limited knowledge) as if you understood what is going on and as if you knew the only solution for the problem.
Does that mean that you added the missing Master/Child link to resolve the problem? I couldn't tell if you were being snarky. Just FYI, "snarky" will get you ignored by the people who actually can help you. It takes a lot more to get yourself banned than being snarky. We are not snowflakes here.That helped me a lot. Thank you so much.
That's why you are getting feedback which does not feel like help, because your original brief was lacking in clarity and conciseness.