Data Type COnversion Error

  • Thread starter Thread starter rata
  • Start date Start date
R

rata

Guest
I am trying to get data from a query. The query selects the latest revision from a list. It returns only one field and will return only one row.

I am getting a Data Type Conversion Error when I run the following code.
Code:
Set qdfApp = dbs.QueryDefs("QryApprovedRev")
    If qdfApp.ReturnsRecords = True Then
        Set rstApp = qdfApp.OpenRecordset("SELECT RevName FROM qdfApp")
        TxtApprev = rstApp!RevName
        rstApp.Close
    End If

I dimension recordsets and querydefs when the page loads. I have also checked the ADO and DAO references as per the recommendations here (I already lost time previously because of those settings.)
 
I don't think you can check the returns records property like that. I think (guessing as the help file here appears to be corrupt) that you need to open the query to see whether it returns anything, in which case you might as well use a recordset and .eof property (if the sql/storedprocedure/query is opened in a recordset and the eof property is set there are no records).


Vince
 
Set a reference to DAO - you probably have a reference defaulted to ADO.

Search here on references for more info - there's an explanatory thread in the FAQ forum.
 

Users who are viewing this thread

Back
Top Bottom