Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript 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
  #1 (permalink)  
Old December 19th, 2005, 03:50 AM
Registered User
 
Join Date: Dec 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Run-time Error: Type missmatch

Hi all,

I'm using Access 2002/XP for my MS Access simple dB project. I have a simple form and when I click on the button, it will trigger the codes below. However, I always receive this Message:

"Run-time error 13: Type Missmatch"


My coding:

Option Compare Database
Option Explicit
Dim dbs As Database
Dim rsUser As Recordset
Dim bolVerify As Boolean

strLogin = Me.txtLogin
strPsd = Me.txtPassword
Set dbs = CurrentDb
Set rsUser = New Recordset
Set rsUser = dbs.OpenRecordset("SELECT * from userlogin")

My userlogin table consist of few text fields. I don't know how to solve this problem. Please help me out. Thanks.
Reply With Quote
  #2 (permalink)  
Old December 21st, 2005, 02:01 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I'm surprised you are not getting undefined variable error messages.

Dim strLogin As String
Dim strPsd As String

Did you put a watch on the code?

HTH


mmcdonal
Reply With Quote
  #3 (permalink)  
Old December 22nd, 2005, 03:41 AM
Registered User
 
Join Date: Dec 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi mmcdonal,

yes i did. I manage to figure out what's wrong with it, after some testing and reading. the declaration of the recordset should be: Dim rsUser As dao.Recordset

For me, the error message don't seem to represent the error itself. Thanks.
Reply With Quote
  #4 (permalink)  
Old December 22nd, 2005, 08:38 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

That sounds like a reference problem. Perhaps you should change the order of references if you have both DAO and ADO selected.

mmcdonal
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
run-time error(s) Chacko C++ Programming 0 March 4th, 2007 02:28 PM
run-time error 13: type mismatch bryan.lugo Excel VBA 2 April 19th, 2006 04:39 AM
OpenRecordset And Run-Time Error 13 Type Mismatch Pavesa Access VBA 5 March 22nd, 2005 05:20 PM
run time error ashishroyk Java GUI 0 October 8th, 2004 01:42 AM





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