access crashing after filter




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

.



Relevant Pages

  • Re: access crashing after filter
    ... tRst.Filter = fil ... This part of the code is unusual for filtering records. ... ElseIf cmbFilter.Value = "Completed" Then ... Set tRst = Me.Recordset ...
    (microsoft.public.access.forms)
  • Re: access crashing after filter
    ... Dim fil As String ... ElseIf cmbFilter.Value = "Completed" Then ... Set tRst = Me.Recordset ... MsgBox tStr, vbInformation, TITLE ...
    (microsoft.public.access.forms)
  • Re: access crashing after filter
    ... that if Access crashes for you- that you keep your data ... ElseIf cmbFilter.Value = "Completed" Then ... I found that this method completes and then the FormCurrent ... All the filtering fields are booleans (BIT on MS SQL Server to be ...
    (microsoft.public.access.forms)

Loading