我有一个宏,允许用户将TempVar(称为" Qvar")定义为任意数字,然后打开一个报告,每页的记录数等于该数字(报告是设置为打印预览):
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.PageBreak104.Visible = (Me.Text102 Mod TempVars("Qvar").Value = 0)
End Sub
带有触发宏的按钮的表单还有一个选项组,允许用户根据五个选项对报表进行排序,在报表的On On事件中使用此选项:
Private Sub Report_Open(Cancel As Integer)
Select Case Forms!FREPLS!Frame35
Case 1
Me.GroupLevel(0).ControlSource = "Wave"
Me.GroupLevel(1).ControlSource = "WHS_ZONE"
Case 2
Me.GroupLevel(0).ControlSource = "WHS_ZONE"
Me.GroupLevel(1).ControlSource = "Wave"
Case 3
Me.GroupLevel(0).ControlSource = "Wave"
Case 4
Me.GroupLevel(0).ControlSource = "WHS_ZONE"
Case 5
Me.GroupLevel(0).ControlSource = "REPL_WRK_ASGN"
End Select
End Sub
这两个子组件都可以自行工作,但是当两者都处于活动状态时我会收到错误" 2427您输入的表达式没有任何值"输入数字后不久," Me.PageBreak104.Visible =(Me.Text102 Mod TempVars(" Qvar")。值= 0)"在第一个子突出显示。据我所知,TempVar正确定义,On Open事件以某种方式干扰了Detail_Format。我花了几天时间环顾四周,似乎无法找到合适的搜索词组合来制作解决方案。非常感谢任何帮助。