Type mismatch

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'm using Access 2002. The following code gives me a type mismatch:

Private Sub Command13_Click()

Dim Rs As Recordset

Set Rs = Me.Recordset

End Sub

If I change my Dim statement to:

Dim Rs As ADODB.Recordset

I still get a type mismatch.

If I try the following:

Dim Rs As DAO.Recordset

then I get the error: Compile error. User-defined type not defined.

I have a reference to Microsoft ActiveX Data Objects 2.5 Library. The
Microsoft DAO Object Libraries are not referenced (they are not checked in the
References dialog). Can somebody please explain to me what's going on?
Ultimately what I'm trying to do is get access to the form's recordset. I'm
working on a company wide application and I already checked that the
workstations are using ADO, not DAO in the Access database applications that
they currently have. I want them to keep using what they are using and not
have to require them to make any changes.


.



Relevant Pages

  • Re: access 2003
    ... Dim ctl As Control ... Dim rs As Recordset ... This sets the query definitions for choosing data to create an invoice using ... Event on combo box: Private Sub ChooseCust_AfterUpdate ...
    (microsoft.public.access.conversion)
  • Re: Error: Microsoft jet database engine does not recognize " as
    ... Report Propoerties window or would it need to be done through the VB code? ... >> ' Variables for Database object and Recordset. ... >> Dim rstReport As DAO.Recordset ... >> Private Sub Detail_Format ...
    (microsoft.public.access.reports)
  • RE: Dynamate report creation....help
    ... mode) in the query and it will construct the report for it. ... time with 26 columns and 200 rows in the recordset before I killed the print ... Dim RptRS As Recordset ... Private Sub Detail1_Format ...
    (microsoft.public.access.reports)
  • Re: Unbound Form Audit Trail (Allen Browne)
    ... You're making it so hard on yourself using an unbound form! ... Dim rstMain As Recordset ... Private sub cmdDelete() ...
    (microsoft.public.access.modulesdaovba)
  • Re: Only retrieving first 50 records?!?
    ... >Dim rs As Recordset ... >Dim strMsg As String ... >Private Sub FORM_CURRENT ... >> The load event should be adequate, ...
    (microsoft.public.access.queries)