speakers_86
Registered User.
- Local time
- Today, 14:59
- Joined
- May 17, 2007
- Messages
- 1,919
So I had this working fine, but after creating a new db and importing all objects to trouble shoot another issue, there is an error now.
It's throwing an error here:
It's a property not found, which I 'fixed' with on error resume next.
It's throwing an error here:
Code:
CurrentDb.Properties("UseAppIconForFrmRpt") = 1
It's a property not found, which I 'fixed' with on error resume next.
Code:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'The following calls the AddAppProperty Function defined below. Changes the app title and icon.
'If using for the first time, must close and reopen to see effects on the form this is called from
On Error Resume Next
Dim intX As Integer
Const DB_Text As Long = 10
intX = AddAppProperty("AppTitle", DB_Text, "SER Database")
intX = AddAppProperty("AppIcon", DB_Text, CurrentProject.path & "\icon.ico")
CurrentDb.Properties("UseAppIconForFrmRpt") = 1
Application.RefreshTitleBar
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
End Sub
'This changes the app icon and title
Function AddAppProperty(strName As String, _
varType As Variant, varValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo AddProp_Err
dbs.Properties(strName) = varValue
AddAppProperty = True
AddProp_Bye:
Exit Function
AddProp_Err:
If Err = conPropNotFoundError Then
Set prp = dbs.CreateProperty(strName, varType, varValue)
dbs.Properties.Append prp
Resume
Else
AddAppProperty = False
Resume AddProp_Bye
End If
End Function