querydef ; invalid argument

alcifer_c

Registered User.
Local time
Today, 17:55
Joined
Jun 3, 2002
Messages
42
hello,

This problem is driving me crazy!

Code:
    Dim db As dao.Database
    Dim qdf As dao.QueryDef
    Set db = CurrentDb
         
    Set qdf = db.CreateQueryDef("hello", "select * from cctv_sites")
    DoCmd.OutputTo acOutputQuery, "hello", acFormatHTML

I am getting an invalid argument error message on:

Set qdf = db.CreateQueryDef("hello", "select * from cctv_sites")

Yet it runs okay on a different computer accessing the same backend data.

Any ideas... thanks, Al
 
in any module check Tools>reference and make sure that DAO is selected at that there are no missing libaries.
HTH

Peter
 
References okay; same on both computers too

I thought of that too... references are the same on both computers.

DAO is selected too.
 
What you have looks fine to me.
I would try creating a new db on the problem machine and try it there to see what happens.

Peter
 

Users who are viewing this thread

Back
Top Bottom