This is the code I'm trying to run from a Standard Module:
When I run this I get Error2465,
But then I run the same code from a button on the form, and instead of
Forms("vr_selection").filter_entrance_Change
I use
call filter_entrance_Change
The code works. Can anyone see why this might be happening
Thank you.
Code:
Public Sub RunPaxCalculations()
Dim frm As Form
Dim intNumberOfRecordsInFilter
Dim i As Integer
Set frm = Forms!vr_selection
'intNumberOfRecordsInFilter = frm.filter_entrance.ListCount
intNumberOfRecordsInFilter = 5 + 1
'Debug.Print intNumberOfRecordsInFilter
For i = 0 To intNumberOfRecordsInFilter
' Debug.Print i
'Debug.Print frm.filter_entrance.Column(0, i)
frm.filter_entrance.Value = frm.filter_entrance.Column(0, i)
Forms("vr_selection").filter_entrance_Change
i = i + 1
Next i
End Sub
But then I run the same code from a button on the form, and instead of
Forms("vr_selection").filter_entrance_Change
I use
call filter_entrance_Change
The code works. Can anyone see why this might be happening
Thank you.