I have 2 forms
Form 1: [frm_DE_VacancyDatabase] and Form2: [frm_CY_NY_Change].
Now Form 2 has 2000 records, but I want to filter it our by the [id] passed from Form 1.
So I did the code on Form2.Open event. But seems do not work, still shows 2000+ records.
I attached my code (form open and form load), please help, thanks.
Private Sub Form_Load()
On Error GoTo Err_Form_Load
'Me.ServerFilterByForm = filterCondtition
Me.ServerFilter = filterCondtition
Forms![SwitchBoard]![PropertyNumber].Caption = Me.[Prop #]
'Forms![SwitchBoard]![Unit].Caption = Me.Unit
If (closeForm) Then
DoCmd.Close acForm, "frm_CY_NY_Change", acSaveNo
Private Sub Form_Open(Cancel As Integer)
On Error GoTo Err_Form_Open
' This occurs BEFORE Form_Load() event handler
closeForm = False
filterCondtition = "[ID]=" & Forms![frm_DE_VacancyDatabase].[ID]
MsgBox "form id is" + (CStr(Forms![frm_DE_VacancyDatabase].[ID]))
closeForm = True
MsgBox "Following error occurred trying to open form:" + vbCrLf + vbCrLf + Err.Description