运行此ACCESS程序时,我在NEWUpdate上遇到失败:'Sub或Function not defined。我点击导入按钮导入所需的excel文件。
Private Sub cmdImport_Click()
NewUpdate
Me.Requery
Me.cboDts.Requery
Me.cboBiller.Requery
这是完整的。
Public Function DoFilter()
Dim mystr As String
mystr = "1=1"
If IsNull(Me.cboDept) = False Then
mystr = mystr & " and [Description] = '" & Me.cboDept & "'"
End If
If IsNull(Me.cboDts) = False Then
mystr = mystr & " and [Service_Date] = #" & Format(Me.cboDts, "m/d/yy") & "#"
End If
If IsNull(Me.cboBiller) = False Then
mystr = mystr & " and [Operator] = '" & Me.cboBiller & "'"
End If
If Me.chkNotBilled = True Then
mystr = mystr & " and [Billing_Date] Is Null"
End If
Me.Filter = mystr
Me.FilterOn = True
End Function
Private Sub cmdImport_Click()
NewUpdate
Me.Requery
Me.cboDts.Requery
Me.cboBiller.Requery
End Sub
Private Sub cmdPrint_Click()
If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord
If Me.FilterOn = True Then
DoCmd.OpenReport "rptPreprinted", acViewPreview, , Me.Filter
Else
DoCmd.OpenReport "rptPreprinted", acViewPreview
End If
End Sub
Private Sub cmdRefresh_Click()
Me.Requery
End Sub
Private Sub cmdShowAll_Click()
Me.Filter = ""
Me.FilterOn = False
Me.cboDept = Null
Me.cboDts = Null
Me.cboBiller = Null
Me.chkNotBilled = False
End Sub
答案 0 :(得分:1)
NewUpdate
函数,这是自定义函数,应该在某处定义。如果您从某处复制了此代码,请搜索此功能的定义,自行定义。