
Recordset: What am I doing wrong?
Quote:
> I am trying to create a recordset using a query in the current database
> as follows:
> Dim ContactsDb As Recordset
> Dim SQLText As String
> SQLText = "SELECT * FROM [TreatmentQueryWithAllTreatersInfo] WHERE
> [CaseID] = " & Me!CaseID
> Set ContactsDb = CurrentDb.OpenRecordset(SQLText)
> I keep getting a Run-time error 13 (type mismatch). What am I doing
> wrong? (CaseID is a long number field.)
If you are using Access 2000, or higher, you need to add a reference to the DAO
Library (see http://support.microsoft.com/default.aspx?scid=KB;EN-US;225962 -
add a "Type Mismatch" error to those listed in the article) and then
disambiguate the Recordset object:
Dim ContactsDb As DAO.Recordset
--
Bruce M. Thompson, Microsoft Access MVP
Quote:
>>No Email, Please. Keep all communications
within the newsgroups so that all might benefit.<<