Access 97 bug?

Hi. I'm stuck on an Access problem and I wondered if anyone had come across this before. I've got an Access 97 database and a module that uses the TransferDatabase method to import make table queries, forms, reports etc, from another database. This works fine. I then open a form which runs db.execute commands to run the queries. This works fine for some queries but not others. The problem queries are the ones that seem to have expressions in them. They come up with a message to the effect that they contain undefined functions. E.g. the function DSum(...) used as an expression for one of the fields in a query will generate the message: "3085 Undefined function 'DSum' in expression." The funny thing is, is that I can run these queries manually with no problem. Not only that, if I simply close the database and then open it up again ( without importing the queries again ) and open the form, the db.execute commands work fine! There seem to be no missing references and no compilation errors. Anybody have any ideas as to how I can get round this?

Thanks.


Comments

  • I don't know about your database purpose and structure, but maybe you could use the Docmd.RunSQL function?

    : Hi. I'm stuck on an Access problem and I wondered if anyone had come across this before. I've got an Access 97 database and a module that uses the TransferDatabase method to import make table queries, forms, reports etc, from another database. This works fine. I then open a form which runs db.execute commands to run the queries. This works fine for some queries but not others. The problem queries are the ones that seem to have expressions in them. They come up with a message to the effect that they contain undefined functions. E.g. the function DSum(...) used as an expression for one of the fields in a query will generate the message: "3085 Undefined function 'DSum' in expression." The funny thing is, is that I can run these queries manually with no problem. Not only that, if I simply close the database and then open it up again ( without importing the queries again ) and open the form, the db.execute commands work fine! There seem to be no missing references and no compilation errors. Anybody have any ideas as to how I can get round this?
    :
    : Thanks.
    :
    :
    :

  • I've considered using this but the SQL query runs to nearly 2 pages! Also I would rather solve the current problem rather than having to 'hack' it ( unless I get really desparate! ). To summarise my main question:
    After automatically importing the queries, why can I run them 'manually', but cannot run them using a db.execute command without errors, except when I close and then re-open the database? What's going on?

    Help..!!


    : I don't know about your database purpose and structure, but maybe you could use the Docmd.RunSQL function?
    :
    : : Hi. I'm stuck on an Access problem and I wondered if anyone had come across this before. I've got an Access 97 database and a module that uses the TransferDatabase method to import make table queries, forms, reports etc, from another database. This works fine. I then open a form which runs db.execute commands to run the queries. This works fine for some queries but not others. The problem queries are the ones that seem to have expressions in them. They come up with a message to the effect that they contain undefined functions. E.g. the function DSum(...) used as an expression for one of the fields in a query will generate the message: "3085 Undefined function 'DSum' in expression." The funny thing is, is that I can run these queries manually with no problem. Not only that, if I simply close the database and then open it up again ( without importing the queries again ) and open the form, the db.execute commands work fine! There seem to be no missing references and no compilation errors. Anybody have any ideas as to how I can get round this?
    : :
    : : Thanks.
    : :
    : :
    : :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories