Office 97 Migration to 2010 - Type Mismatch error 13

bisjom

New member
Local time
Today, 12:47
Joined
Jan 30, 2014
Messages
2
Hi ,
I upgraded an Office 97 application , which doesnt have much information about any connections etc. to MS Office 2010. This is talking to a SQL database with ODBC connection.
All the functions are working, But when i open this, I am getting the error TypeMismatch error 13.
This is because its calling a particular function to reset the displae.
Code:
Public Sub ResetDisplay()
    Dim objRst As Recordset
    Dim strSQL, strTotalPatients, extract_dt_tm As String
   strSQL = "SELECT Count(alias) AS TotalPatients FROM tblSafetyNet WHERE IsNull(Departure_dt_tm)"
    Set objRst = CurrentDb.OpenRecordset(strSQL)
    Set strTotalPatients = objRst.Fields("TotalPatients")
    objRst.Close
    
     strSQL = "SELECT TOP 1 extract_dt_tm FROM tblSafetyNet"
    Set objRst = CurrentDb.OpenRecordset(strSQL)
    If IsNull(objRst.Fields("extract_dt_tm")) = False And objRst.EOF = False Then
        extract_dt_tm = objRst.Fields("extract_dt_tm")
    Else
        extract_dt_tm = Format(Now(), "dd/mm/yy hh:nn")
    End If
    
    objRst.Close
    
    Set objRst = Nothing
    
    lblInfo.Caption = "At " & Format(extract_dt_tm, "d/m hh:nn")
    lblPatientCount.Caption = "All Patients (" & strTotalPatients & "/" & strTotalPatients & ")"
    
    cboPatient.Requery
    [fsubData].Form.Requery
    [fsubDataDisCharge].Form.Requery
End Sub

Any idea to fix this/
This is very urgent task that assigned to me and any help is highly appreciated.

Thansk.
BJ
 
Welcome to the forum.

For best results when troubleshooting a compile or runtime error: indicate the line on which it occurs.
Cheers,
 
Possible references problem: the function it used no longer exists in the libraries of the more modern program. In the VBA editor you can go to Tool, then References, and tell the system to also load older libraries (you'll need to look up what the office 97 libraries were called). Many times this has solved similar problems for me.
 
Hi,
I solved this problem by adding some libraries. but Still having different issues. My MS Access applciation had one server application and another client application. I cant open the client application, saying active x catn create object, function or interface marked as restricted, or the function uses an automation type not supported in VB and subscript out of range.
There is no doc or any other help avialable for this applciation and I want to make it working.
How can I know which references I should add.
The current ones are :
VB for Applicaitons
MS Access 8.0 Object Library
OLE Automation
MS Active X data Objects 2.5
MS DAO 3.6
I cant see any compatibility objects

Please help

Thanks
Bisjom
 
I think you want the office references version 14.0, not 8.0. There should be a
MS Access 14.0 Object Library
line in the references selection window somewhere that you can use.
 

Users who are viewing this thread

Back
Top Bottom