T
Tony_VBACoder
Here is the code that I use in my ApplicationInitialize
routine:
' Set the icon for the application. If the file is not
found, Access will default to nothing
SetStartupOptions "AppIcon", 10, sCurrentDBPath
& "Files\check.ico"
Public Sub SetStartupOptions(sPropertyName As String, _
vPropertyType As Variant,
sPropertyValue As String)
Dim dbs As Object
Dim prp As Object
Set dbs = Application.CurrentDb
On Error Resume Next
' Check to make sure this doesn't already exist
If dbs.Properties(sPropertyName) = sPropertyValue Then
' This already exists - do nothing
Set dbs = Nothing
Exit Sub
End If
dbs.Properties(sPropertyName) = sPropertyValue
Set prp = dbs.CreateProperty(sPropertyName, vPropertyType,
sPropertyValue)
dbs.Properties.Append prp
Application.RefreshTitleBar
Set dbs = Nothing
Set prp = Nothing
End Sub
and reopen it for the icon to show up.
routine:
' Set the icon for the application. If the file is not
found, Access will default to nothing
SetStartupOptions "AppIcon", 10, sCurrentDBPath
& "Files\check.ico"
Public Sub SetStartupOptions(sPropertyName As String, _
vPropertyType As Variant,
sPropertyValue As String)
Dim dbs As Object
Dim prp As Object
Set dbs = Application.CurrentDb
On Error Resume Next
' Check to make sure this doesn't already exist
If dbs.Properties(sPropertyName) = sPropertyValue Then
' This already exists - do nothing
Set dbs = Nothing
Exit Sub
End If
dbs.Properties(sPropertyName) = sPropertyValue
Set prp = dbs.CreateProperty(sPropertyName, vPropertyType,
sPropertyValue)
dbs.Properties.Append prp
Application.RefreshTitleBar
Set dbs = Nothing
Set prp = Nothing
End Sub
run the code with a AutoExec macro. I have to close the db-----Original Message-----
Hi,
I'm updating the program Icon with this property
CurrentDb.Containers!Databases.Documents!MSysDb.Properties ("AppIcon")
However, the changes don't appear right away, even when I
and reopen it for the icon to show up.