Jim Dettman
jimdettman at earthlink.net
Sat Jun 5 07:22:25 CDT 2004
Martin, If your not going to use both DAO and ADO, then you should uncheck one. If you are going to use both, then you should start declaring everything explicitly: Dim rst As DAO.Recordset Dim db As DAO.Database Jim (315) 699-3443 jimdettman at earthlink.net -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Martin Caro Sent: Friday, June 04, 2004 9:02 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Type Mismatch Thanks Stuart I didn't even consider references - I moved DAO up the list and the error went away Martin ----- Original Message ----- From: "Stuart McLachlan" <stuart at lexacorp.com.pg> To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com> Sent: Saturday, June 05, 2004 10:17 AM Subject: Re: [AccessD] Type Mismatch > On 5 Jun 2004 at 9:41, Bigpond wrote: > > > Hi folks > > > > I'm getting a Type Mismatch (13) error on the OpenRecordset line of the following code > > > > Private Sub cmdTest_Click() > > Dim rst As Recordset > > Dim db As Database > > On Error GoTo HandleErrors > > Set db = CurrentDb() > > Set rst = db.OpenRecordset("SELECT DISTINCT ClientTypeID FROM GBBClients") > > . > > . > > End Sub > > > > I have checked the table "GBBClients" and the field "ClientTypeID" is a number. > > I inserted a text field called "ClientType" into the table and the following line also give the same error. > > > > Set rst = db.OpenRecordset("SELECT DISTINCT ClientType FROM GBBClients") > > > > Is it so obvious that I can't see it?????? > > > > DAO/ADODB ? Do you have both referenced and if so, in what order. > You will get this error with an ADODB recordset. > > > > > > > -- > Lexacorp Ltd > http://www.lexacorp.com.pg > Information Technology Consultancy, Software Development,System Support. > > > > -- > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com