本文介绍了在报表中选择子报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有一个报告,在两个地方(43a和43b)我需要插入三个子报告中的一个,具体取决于谁付钱。我在Current事件中使用了以下代码: Private Sub Report_Current() 如果Queries.qry_LOI。[Who_pays] =" B"然后 Set Me。[subrpt_43a_BothPay] .Visible = True: Set Me。[subrpt_43a_PilgrimPays] .Visible = False: Set Me。 [subrpt_43a_SponsorPays] .Visible = False: Set Me。[subrpt_43b_BothPay] .Visible = True: Set Me。[subrpt_43b_PilgrimPays] .Visible = False: Set Me。[subrpt_43b_SponsorPays] .Visible = False ElseIf Queries.qry_LOI。[Who_pays] =" S"然后 Set Me。[subrpt_43a_BothPay] .Visible = False: Set Me。[subrpt_43a_PilgrimPays] .Visible = False: Set Me。 [subrpt_43a_SponsorPays] .Visible = True: Set Me。[subrpt_43b_BothPay] .Visible = False: Set Me。[subrpt_43b_PilgrimPays] .Visible = False: Set Me。[subrpt_43b_SponsorPays] .Visible = True Else Set Me。[subrpt_43a_BothPay] .Visible = False: 设置我。[subrpt_43a_PilgrimPays] .Visible = True: Set Me。[subrpt_43a_SponsorPays] .Visible = False: Set Me。[subrpt_43b_BothPay] .Visible = False: Set Me。[subrpt_43b_PilgrimPays] .Visible = True: Set Me。[subrpt_43b_SponsorPays] .Visible = False 结束如果 结束子 然而它不起作用。如果我在报表视图中向下滚动子报表都保持可见,但如果我向下翻页,我会在单词Visible上收到VBA编译错误,说无效使用属性。 任何人都可以看到我做错了吗?I have a report where in two places (43a and 43b) I need to insert one of three subreports, depending on who is paying. I used the following code in the Current event:Private Sub Report_Current()If Queries.qry_LOI.[Who_pays] = "B" Then Set Me.[subrpt_43a_BothPay].Visible = True: Set Me.[subrpt_43a_PilgrimPays].Visible = False: Set Me.[subrpt_43a_SponsorPays].Visible = False: Set Me.[subrpt_43b_BothPay].Visible = True: Set Me.[subrpt_43b_PilgrimPays].Visible = False: Set Me.[subrpt_43b_SponsorPays].Visible = FalseElseIf Queries.qry_LOI.[Who_pays] = "S" Then Set Me.[subrpt_43a_BothPay].Visible = False: Set Me.[subrpt_43a_PilgrimPays].Visible = False: Set Me.[subrpt_43a_SponsorPays].Visible = True: Set Me.[subrpt_43b_BothPay].Visible = False: Set Me.[subrpt_43b_PilgrimPays].Visible = False: Set Me.[subrpt_43b_SponsorPays].Visible = TrueElse Set Me.[subrpt_43a_BothPay].Visible = False: Set Me.[subrpt_43a_PilgrimPays].Visible = True: Set Me.[subrpt_43a_SponsorPays].Visible = False: Set Me.[subrpt_43b_BothPay].Visible = False: Set Me.[subrpt_43b_PilgrimPays].Visible = True: Set Me.[subrpt_43b_SponsorPays].Visible = FalseEnd IfEnd SubHowever it doesn''t work. If I scroll down in report view the subreports all stay visible, but if I page down I get a VBA compile error on the word "Visible", saying "Invalid use of property".Can anyone see what I''m doing wrong?推荐答案 展开 | 选择 | 换行 | 行号 这篇关于在报表中选择子报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-29 03:42