Run Time Error - 13 Type Mismatch and Don't know why ???

J

Jean

Hi,

I am trying to convert my MS ACCESS 97 MDB to MS ACCESS 2000.
I made sure that Microsoft DAO 2.5/3.5 Compatibility Library is loaded
(checked), but not Microsoft DAO 3.51 Compatibility Library nor DAO 3.6
Compatiblity Library.

At run time, this line code :

Set rsMyRS = dbMyDB.OpenRecordset("Database Data Changes", dbOpenDynaset)

gives this error message " Run Time Error - 13 Type Mismatch " . The table
Database Data Changes is a valid working table. The login name do have full
admin rights.

Below is the full code. Any suggestion is welcome.

Thanks

Jean

----------------------------------------------------------------------------
---------------
Dim dbMyDB As Database
Dim rsMyRS As Recordset
If Me![records already created] = 0 Then
Me![records already created] = -1
Me![Created by Curator] = -1
Me![Who created record] = CurrentUser()
Else
Me![Last Date Change] = Now()
Set dbMyDB = CurrentDb
'''''''''''''''''' Problem starts here ''''''''''''''''''''''''
Set rsMyRS = dbMyDB.OpenRecordset("Database Data Changes",
dbOpenDynaset)

rsMyRS.AddNew
rsMyRS("Table Name") = "FunTable"
rsMyRS("Field Name") = "Artist Code"
rsMyRS("Record ID") = Me![ID]
rsMyRS("Change Date") = Now()
rsMyRS("User") = CurrentUser()
rsMyRS("New Value") = Me![Artist code]
rsMyRS.Update
rsMyRS.Close
dbMyDB.Close
End If
 
V

Van T. Dinh

Try change your declaration to:

Dim rsMyRS As DAO.Recordset

However, I don't think DAO 2.5/3.5 Compatibility Library is the correct
Library to use in A2K. It was meant for databases converted from Access 2 /
Access95 to A97 format. Since you are using A2k, you should really be using
DAO 3.6 Library.
 
J

Jean

Van,

Thanks. You are right !

Jean


Van T. Dinh said:
Try change your declaration to:

Dim rsMyRS As DAO.Recordset

However, I don't think DAO 2.5/3.5 Compatibility Library is the correct
Library to use in A2K. It was meant for databases converted from Access 2 /
Access95 to A97 format. Since you are using A2k, you should really be using
DAO 3.6 Library.

--
HTH
Van T. Dinh
MVP (Access)



Jean said:
Hi,

I am trying to convert my MS ACCESS 97 MDB to MS ACCESS 2000.
I made sure that Microsoft DAO 2.5/3.5 Compatibility Library is loaded
(checked), but not Microsoft DAO 3.51 Compatibility Library nor DAO 3.6
Compatiblity Library.

At run time, this line code :

Set rsMyRS = dbMyDB.OpenRecordset("Database Data Changes", dbOpenDynaset)

gives this error message " Run Time Error - 13 Type Mismatch " . The table
Database Data Changes is a valid working table. The login name do have full
admin rights.

Below is the full code. Any suggestion is welcome.

Thanks

Jean

--------------------------------------------------------------------------
--
---------------
Dim dbMyDB As Database
Dim rsMyRS As Recordset
If Me![records already created] = 0 Then
Me![records already created] = -1
Me![Created by Curator] = -1
Me![Who created record] = CurrentUser()
Else
Me![Last Date Change] = Now()
Set dbMyDB = CurrentDb
'''''''''''''''''' Problem starts here ''''''''''''''''''''''''
Set rsMyRS = dbMyDB.OpenRecordset("Database Data Changes",
dbOpenDynaset)

rsMyRS.AddNew
rsMyRS("Table Name") = "FunTable"
rsMyRS("Field Name") = "Artist Code"
rsMyRS("Record ID") = Me![ID]
rsMyRS("Change Date") = Now()
rsMyRS("User") = CurrentUser()
rsMyRS("New Value") = Me![Artist code]
rsMyRS.Update
rsMyRS.Close
dbMyDB.Close
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top