Re: access crashing after filter



On May 9, 4:43 pm, "BruceM" <bam...@xxxxxxxxxxxxxxxxx> wrote:
It isn't so much a case of not understanding as not knowing you are using
SQL server and an ADO recordset. Maybe I should have known that from the
code, but I didn't. It seems you are saying that tRst.Filter = "my filter"
results in the recordset tRst being redefined as a filtered recordset, so
that in the line Set Me.Recordset = tRst, Me.Recordset is now the filtered
recordset without specifically applying the filter.
My comments about error handling still apply. If you use error handling in
the procedure (or maybe set the code to break on all errors) you should be
able to find out what error is causing the crash. If the code isn't
reaching your Debug.Print line, why not try putting a Debug.Print line
elsewhere, such as before the line that is causing the crash to see if tRst
is what you expect?

from my second post.
Set Me.Recordset = tRst 'Crash here after Form_Current completes
successfully
Debug.Print tRst.RecordCount

Also of note. When the crash message is displayed the form has
CORRECTLY updated to reflect the filtered results. Hence, it appears
its a problem inherent in Access.

I have already given up on this approach with Access

Riyaz

.



Relevant Pages

  • Re: access crashing after filter
    ... You have the Debug.Print line after the line that is causing the problem. ... What happens if you comment out the line that is causing the crash? ... using an ADO recordset and SQL server, the definition of variables (we can't ... recordset without specifically applying the filter. ...
    (microsoft.public.access.forms)
  • Re: Help with Microsoft help on linking Access to Outlook
    ... in the criteria cell in the graphical query builder. ... use as the source in the routine. ... the same filtered recordset every time. ... choose themselves what fields to filter on. ...
    (microsoft.public.access.formscoding)
  • Re: Help with Microsoft help on linking Access to Outlook
    ... should build the SQL, using a query, then paste it into your code. ... the same filtered recordset every time. ... choose themselves what fields to filter on. ... Set MyRS = MyDB.OpenRecordset" ...
    (microsoft.public.access.formscoding)
  • Re: Help with Microsoft help on linking Access to Outlook
    ... and have the query point to the combo box to get its value. ... the same filtered recordset every time. ... choose themselves what fields to filter on. ... Set MyRS = MyDB.OpenRecordset" ...
    (microsoft.public.access.formscoding)
  • RE: "too few parameters expected" when filtering OpenRecordset
    ... the filter line doesn't look right. ... The only solution I know of is to add a column in the query to get the ... into a second recordset and then assign the second recordset to the listbox. ... 'Define the SQL to run the stored proc ...
    (microsoft.public.access.modulesdaovba)

Loading