[AccessD] Error help with upgrade from A03 to A13
John R Bartow
jbartow at winhaven.net
Tue Nov 15 19:29:53 CST 2016
Converting a Access 2003 app that was originally an Access97 app to an
Access 2013 app.
Converted the mdbs to 07 accdbs.
It compiles but I get two errors when running the Splash Screen which does
some environment checks and opens the login screen. Any help appreciated.
I'm getting errors on this:
Set prp = dbs.Properties("CheckForLabelPrinter")
1st error occurs here: "Type mismatch"
If prp = True Then
2nd error occurs here: Object Variable or With block variable not set
Full form code:
' Module : frmSplash
' Description: environment checks then opens the next screen
' Procedures : Form_Timer
' InitErrorLog
Option Compare Database
Option Explicit
Private Sub Form_Timer()
' Comments :
' Parameters : -
' Returns : -
Dim dbs As Database
Dim prp As Property
Set dbs = CurrentDb()
On Error GoTo PROC_ERR
'Check to see if database connection is valid
If CheckForDB("Staff") = True Then
'Check to see if Dymo Label Printer is installed
'read database property to see if we should check it
Set prp = dbs.Properties("CheckForLabelPrinter")
If prp = True Then
If Len(DymoAddinPath()) > 0 Then
gfDymoInstalled = True
Else
gfDymoInstalled = False
End If
Else
gfDymoInstalled = False
End If
' initialize the error log
Call InitErrorLog
'Set Registry Name of App Form Settings
Dim strAppName As String
'lookup the name of the application name and version
strAppName = DLookup("[fldAppName]", "uSysLicense", "[fldKeyID] = 1")
RunningProject (strAppName)
'Check to see if we can bypass login procedure because they are logged
into the OS
If GetStaffName() = True Then
'OK skip login procedures
DoCmd.OpenForm "fmnuMainMenu", acNormal, "", "", acEdit, acNormal
Else
'Can't find them in the Staff table, make them login
DoCmd.OpenForm "frmLogin", acNormal, "", "", acEdit, acNormal
End If
End If
DoCmd.Close acForm, "frmSplash"
Exit Sub
PROC_ERR:
MsgBox "The following error occurred: " & Error$
Resume Next
End Sub
Private Sub InitErrorLog()
' Comments :
' Parameters : -
' Returns : -
On Error GoTo PROC_ERR
' initialize the error log.
Dim fOk As Boolean
fOk = ERH_Initialize_TSB()
If Not fOk Then
Beep
MsgBox "Could not initialize error handler, application will exit."
End
End If
Exit Sub
PROC_ERR:
MsgBox "The following error occurred: " & Error$
Resume Next
End Sub
More information about the AccessD
mailing list