3
Private Sub OccurrenceName_AfterUpdate()
If OccurrenceName.Value = "Other" Then
Dim strTechID As String
Dim strOccurrenceCt As String
Dim strOccurrenceDate As String
strTechID = Me.Parent.tbxTechID.Value
strOccurrenceCt = Forms![frmEmployeeOccurrenceInput]![tbxOccurrence].Value
strOccurrenceDate = Me.OccurrenceDate.Value
Dim strOpenArgs As String
strOpenArgs = strTechID & "|" & strOccurrenceCt & "|" & strOccurrenceDate
DoCmd.OpenForm "frmOtherOccurrence", , , , , , strOpenArgs
Else
Me.OccurrenceAmt = Me.OccurrenceName.Column(1)
Me.Type = Me.OccurrenceName.Column(2)
End If
End Sub
它运行我得到“开放形式操作被取消”与2501的线就被抓上一个错误代码每次都是DoCmd.OpenForm
电话。调试不会提供其他信息。访问VBA DoCmd.OpenForm“操作已取消”
这里就是OpenArgs
传递到:
Private Sub Form_Load()
Dim aryOA As Variant
aryOA = Split(Me.OpenArgs, "|")
Me.lblTechID.Caption = aryOA(0)
Me.lblOccurrenceCt.Caption = aryOA(1)
Me.lblOccurrenceDate.Caption = aryOA(2)
End Sub
手动打开frmOtherOccurrence吗?当你通过代码时会发生什么? Open事件中的任何代码?你最近有反编译吗?压实和修复? – Fionnuala
紧凑和修复后,它的工作原理...我需要多久做一次?为什么会导致事情无法正常工作...... – Zamael
当你正在开发和紧凑和修复清除它们时,事情会得到保持。在开发过程中,您需要定期进行备份,反编译和紧凑修复。 – Fionnuala