When I run some code behind a button i get a runtime error message. The strange thing is that the code run perfectly some months ago. Can some one help me !
Some additional information: The company I work for upgraded the citrix enviremont.
Here is the code:
The error ocurs by on line 30 --> forms!frmbeursk aarten.filteron = true
Some additional information: The company I work for upgraded the citrix enviremont.
Here is the code:
Code:
Private Sub knptoevoegen_Click()
On Error GoTo err_knptoevoegen_click
Dim filid As Variant
Dim beursid As Variant
Dim fout As Integer
If IsNull(Me.Klantnummer) Or IsNull(Me.Aantal) Or IsNull(Me.Beurs) Then
MsgBox ("U kunt niet toevoegen. Formulier is niet volledig ingevuld ! "), vbOKOnly
Forms!frmbeurskaart.FilterOn = False
Else
Forms!frmbeurskaart.FilterOn = False
DoCmd.GoToRecord , , acNewRec
End If
err_knptoevoegen_click:
fout = Err.Number
Select Case fout
Case 0
Case 2105
If MsgBox("Deze relatie heeft al beurskaarten besteldt voor deze beurs! Wilt u deze aanpassen ?", vbYesNo) = vbYes Then
filid = Forms!frmbeurskaart!Klantnummer
beursid = Forms!frmbeurskaart!Beurs
Forms!frmbeurskaart.Filter = "Klantnummer =" & filid & "and beurs ='" & beursid & "'"
Me.Undo
Forms!frmbeurskaart.FilterOn = True
Me.Aantal.SetFocus
Else
Me.Undo
End If
End Select
End Sub
Comment