Re: access crashing after filter



You have the Debug.Print line after the line that is causing the problem.
My suggestion was that a Debug.Print line *before* the problem line of code
would be of potential value. Debug.Print after the code has failed will
suggest nothing about the cause for the failure.
What happens if you comment out the line that is causing the crash? If the
recordset has been filtered properly, what do you hope to accomplish by that
line of code?
I very much doubt this is an inherent problem with Access. The application
crashes at a line of code and you seem to be wondering what is wrong with
the application. I would suggest that when posting such a question you
should include from the beginning relevant information such as that you are
using an ADO recordset and SQL server, the definition of variables (we can't
see that tRst has been declared at the form module level, or what it is),
and information such as the fact that the recordset is filtered properly
before the crash. If the code compiled without problems, that is worth
mentioning too.

<riyaz.mansoor@xxxxxxxxx> wrote in message
news:1178766832.488740.91880@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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: Cannot edit form
    ... It is definately the form that is causing the problem! ... The macro and table are fine. ... Recordset defined as Dynaset? ... > may be a conflict between the filter code and the ...
    (microsoft.public.access.forms)
  • Re: access crashing after filter
    ... SQL server and an ADO recordset. ... recordset without specifically applying the filter. ... My comments about error handling still apply. ... able to find out what error is causing the crash. ...
    (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)