I recently installed Office 2021 64-bit and can not change the title icon. I don't have any issues changing the title or using the icon on forms and reports. I have used the GUI to select the icon (.ico and .bmp), but neither works. I found some code to be called when the login form opens, and I noticed a flicker of the container title icon changing, but it reverts to the Access branding icon. I am hoping someone has experienced this and might have a workaround.
I am using the following VBA code:
cmdAddProp 'on login Form_Load
'Global module
Public Sub cmdAddProp()
Dim intX As Integer
Const DB_Text As Long = 10
intX = AddAppProperty("AppTitle", DB_Text, "Equipment Scanning")
intX = AddAppProperty("AppIcon", DB_Text, "C:\Temp\Equipment Scanning\Images\Gear-01-WF.ico")
CurrentDb.Properties("UseAppIconForFrmRpt") = 1
Application.RefreshTitleBar
End Sub
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
Thanks in advance.
I am using the following VBA code:
cmdAddProp 'on login Form_Load
'Global module
Public Sub cmdAddProp()
Dim intX As Integer
Const DB_Text As Long = 10
intX = AddAppProperty("AppTitle", DB_Text, "Equipment Scanning")
intX = AddAppProperty("AppIcon", DB_Text, "C:\Temp\Equipment Scanning\Images\Gear-01-WF.ico")
CurrentDb.Properties("UseAppIconForFrmRpt") = 1
Application.RefreshTitleBar
End Sub
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
Thanks in advance.