我有一個表單(比如 form1)導航到另一個表單(form2),該表單有一個子表單,該子表單根據通過選擇 form1 上的文本框放入的 DataSource 打開報告。
代碼看起來像這樣
Private Sub txt_DeliveryItemsSummary_Click()
DoCmd.OpenForm "frm_viewReports", acNormal
Forms!frm_ViewReports!subrpt_ReportArea.SourceObject = "Report.rpt_DeliveryItemsSummary"
End Sub
在form2上我有一個列印按鈕來列印報告代碼看起來像這樣
DoCmd.OpenReport subrpt_ReportArea.SourceObject, acViewNormal, , , acWindowNormal
但是這段代碼給出了以下錯誤
運行時錯誤 2103
您在屬性表或宏中輸入的報告名稱“Report.rpt_DeliveryItemsSummary”拼寫錯誤或參考不存在的報告。
任何幫助我如何解決這個問題。
提前非常感謝。
uj5u.com熱心網友回復:
只是我自己想通了。我知道我需要跳過一段文字,但是怎么做!我遇到了麻煩。
這是作業代碼
DoCmd.OpenReport Right(subrpt_ReportArea.SourceObject, Len(subrpt_ReportArea.SourceObject) - 7), , acViewNormal, , , acWindowNormal
感謝@Gustav 再次與我們聯系。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/468358.html
