Martin Caro
mcaro at bigpond.net.au
Fri Jun 4 20:01:44 CDT 2004
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 >