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
Every time it runs I get "The Open Form action was canceled" with an error code of 2501. The line it gets caught on is the DoCmd.OpenForm
call. Debugging give NO additional information.
Here is where the OpenArgs
is passed to:
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