我在 Access 中设计了一个简单的表单和一些报告。我在 Windows 7 和 Access 2010 中设计了它,当我在具有 Access 运行时的 Windows XP PC 上打开它时,我收到错误“您输入的单击表达式,因为事件属性设置产生了以下错误”。 请问有人可以帮我解决这个问题吗?
Private Sub cmdShoppingList_Click()
On Error GoTo Err_cmdShoppingList_Click
Dim stDocName As String
stDocName = "Shopping List"
DoCmd.OpenReport stDocName, acViewReport
Exit_cmdShoppingList_Click:
Exit Sub
Err_cmdShoppingList_Click:
MsgBox Err.Description
Resume Exit_cmdShoppingList_Click
End Sub
希望尽快得到答复。这是我的错误消息的图片:
由于它可以在 Windows 7 中运行,但不能在 Windows XP 中运行,所以在我看来,您可能在仅存在于 Windows 7 中的报表上放置了 ActiveX 控件。在分发 MS Access 数据库/项目时,您需要分发任何内容您在目标计算机上使用过的 DLL/OCX。