Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 6th, 2005, 03:12 PM
Authorized User
 
Join Date: Apr 2004
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lguzman
Default Error 13 Type Mismatch

Good day all.

I am getting an error '13' Type Mismatch on the following line of the following code:

Private Sub Text45_AfterUpdate()
Dim wrkDefault As Workspace
Dim dbs As Database
Dim rst As Recordset
Set wrkDefault = DBEngine.Workspaces(0)
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tInvent") <<<<<------- error 13
wrkDefault.BeginTrans
...


I don't see why! Please help!

Thanks.




[LGuzman]
__________________
[LGuzman]
 
Old January 6th, 2005, 03:52 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I may be wrong here but aren't you missing a step?

Dim dao As DAO.DBEngine
Dim wks As Workspace
Dim dbs As Database
Dim rst As Recordset

Set dao = CreateObject("DAO.DBEngine.35")
Set wks = dao.Workspaces(0)
Set dbs = wks.OpenDatabase(strDBName)
Set rst = dbs.OpenRecordset(strTableName)

See http://www.oreilly.com/catalog/proga...pter/ch02.html

I don't do any DAO really, so I hope this helps.




mmcdonal
 
Old January 6th, 2005, 10:19 PM
Registered User
 
Join Date: Dec 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think problem is with ur database virsion. if it is MS Access 2003 or higher convert it to 2000. Send me ur full project and database [email protected]






Similar Threads
Thread Thread Starter Forum Replies Last Post
getting runtime error 13: type mismatch rita9 Beginning VB 6 2 March 14th, 2008 04:36 AM
Error Number 13 : Type Mismatch ryoga_7482 BOOK: Expert Access 2007 Programming ISBN 978-0-470-17402-9 2 January 31st, 2008 02:20 AM
runtime error '13' type mismatch denkidude Visual Basic 2005 Basics 5 March 15th, 2007 10:28 PM
Why am I getting Runtime Error 13: Type Mismatch? dan_thorman Excel VBA 1 January 24th, 2007 02:06 PM
run-time error 13: type mismatch bryan.lugo Excel VBA 2 April 19th, 2006 04:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.