R
riyaz.mansoor
MS Access 2003 SP2
The following code runs on the AfterUpdate event on control cmbFilter
If cmbFilter.Value = "None" Then
fil = ""
ElseIf cmbFilter.Value = "Current" Then
fil = "B_Completed=0 AND B_Waived=0 AND B_Loss=0"
ElseIf cmbFilter.Value = "Completed" Then
fil = "B_Completed=1"
ElseIf cmbFilter.Value = "Waived" Then
fil = "B_Waived=1"
ElseIf cmbFilter.Value = "Loss" Then
fil = "B_Loss=1"
Else
Err.Raise 1024, "error"
End If
Set tRst = Me.Recordset
tRst.Filter = fil
The form is backed by a code generated Recordset. When 'Current' is
selected, MS Access crashes asking to sen d the error report to MS. On
debugging, I found that this method completes and then the FormCurrent
method also completes without error. But right after FormCurrent
completes, MS Access crashes.
I also suspect that the crash does not happend if a filter already
exists when 'Current' is called.
1) 'Completed' -> 'Current' ===> NO crash
2) 'None' -> 'Current' ===> CRASH
All the filtering fields are booleans (BIT on MS SQL Server to be
exact). What could i do?
Please help
Riyaz
The following code runs on the AfterUpdate event on control cmbFilter
If cmbFilter.Value = "None" Then
fil = ""
ElseIf cmbFilter.Value = "Current" Then
fil = "B_Completed=0 AND B_Waived=0 AND B_Loss=0"
ElseIf cmbFilter.Value = "Completed" Then
fil = "B_Completed=1"
ElseIf cmbFilter.Value = "Waived" Then
fil = "B_Waived=1"
ElseIf cmbFilter.Value = "Loss" Then
fil = "B_Loss=1"
Else
Err.Raise 1024, "error"
End If
Set tRst = Me.Recordset
tRst.Filter = fil
The form is backed by a code generated Recordset. When 'Current' is
selected, MS Access crashes asking to sen d the error report to MS. On
debugging, I found that this method completes and then the FormCurrent
method also completes without error. But right after FormCurrent
completes, MS Access crashes.
I also suspect that the crash does not happend if a filter already
exists when 'Current' is called.
1) 'Completed' -> 'Current' ===> NO crash
2) 'None' -> 'Current' ===> CRASH
All the filtering fields are booleans (BIT on MS SQL Server to be
exact). What could i do?
Please help
Riyaz