Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    228

    Red face Unanswered: possible Access bug

    I think I'm hitting a serious Access 2000 bug. Do the following:

    Create a form with a subform. Place a control on the subform with the data source: =DCount("*";"TableOfYourSubForm";"someID = " & [Forms]![YourMainForm]![someID])
    Hope you get what I mean.

    Open your form and see it working like a charm, it displays the count of records in the subform. Now place a filter on the form (not in the form properties but with right click and so on). That's the place where it starts to go all wrong for me. The control isn't updated anymore then. Controls might lose their background colour. It is not possible to run any code from now on anymore. You can't open any Forms and you'll either have to kill Access via the task manager or it crashes itself with either a GPF or a C++ runtime library 'abnormal program termination'. Now I tried this on different comps with different dbs on different backends. All the same result. Can someone confirm this problem or am I just an unlucky guy with 50 broken Access installations?


    Michael

  2. #2
    Join Date
    Feb 2002
    Posts
    403
    Maybe try using the TCount function from Access Web. This is a recordset based counting system and may fix your problem.

    Dcount, Dlookup and so on are not particularly efficent. They look at every record in the underlying table and compare line by line for matches. This can lead to memory bloat, slow running of application and other interesting side effects.

  3. #3
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    228
    Yes, I know. But the nifty thing about the DCount is it's running asynchronous thus not blocking nagation where a function does that.

  4. #4
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    228
    Oh well, I just found a workaround for the problem:

    before you do any modification to either the recordsource or the filter property of the main for set the ControlSource property to an empty string and reset it after the changes has been applied.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •