borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Word Macro Runtime Error 6124)Next Topic (Unexpected behavior with for each loop) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Problem with OpenRecordSet
Poster Message
jfletcher77055
Level: Protégé

Registered: 03-12-2008
Posts: 4

Ads by Lake Quincy Media
icon Problem with OpenRecordSet

I have tried everything I can think of and now I must give up and post a question.  I have some simple code that worked fine when I set it up in Access 2003, but does not work in the version I converted into Access 2007.  Here is the code:

    Dim db1 As Database
    Dim rs1 As Recordset
    Set db1 = CurrentDb
    Set rs1 = db1.OpenRecordset("Overby_Seawall_Non_DUPLEX_Files")

I get a 13 Type Mismatch error on the OpenRecordset.
I have another application in which I am opening a recordset using a query.  In that case I set the type to dbOpenDynaset.  It works properly.  I have compared the references in both of these applications and they are the same.  I have tried both dbOpenDynaset and dbOpenTable with this one and it still gets the same error.  What to do?  

14-04-2009 at 08:37 PM
View Profile Send Email to User Show All Posts | Quote Reply
jfletcher77055
Level: Protégé

Registered: 03-12-2008
Posts: 4
icon Re: Problem with OpenRecordSet

I found the answer after more google searches.  I tried
Dim rs1 as DAO.RecordSet and it worked.  The weird part is that this problem was using a script from Access 2007 in Access 2003.  I guess not every problem belongs to Access 2007.
Thanks
J.

14-04-2009 at 09:42 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Problem with OpenRecordSet
Previous Topic (Word Macro Runtime Error 6124)Next Topic (Unexpected behavior with for each loop) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder