Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run time error '13 Type Mismatch

Status
Not open for further replies.

PL01

Technical User
Jun 9, 2008
57
US
Dim myConnection03 As ADODB.Connection
Set myConnection03 = CurrentProject.Connection
Dim myRecordset03 As New ADODB.Recordset
myRecordset03.ActiveConnection = myConnection03
myRecordset03.Open "TempBin", , adOpenDynamic, adLockOptimistic

I keep getting the error message

"Run time error '13 Type Mismatch"

on the line of VBA code below. If I delete the line and retype it the program runs through ok. It hasn't been a disaster yet, but has me worried. Any ideas why this is happening?

"Set myConnection03 = CurrentProject.Connection"
 
There is corrupt compiled code in your module....

Try running Access with the decompile swictch on your application file, doing a "compact and reapair" and then compiling the code again.

Code:
Msaccess.exe "<File with Path for your applciation>" /decomplie

I generally just create a shortcut rather than going to the command prompt because you can copy and paste that way.

The other way to fix this is to import all objects into a new file but you lose any database properties you have set like startup form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top