Hi everyone,
I've got the next code in a closed thread by LarrySteele (Programmer) 20 Oct 06 12:11. He gives a function to set the application icon through code.
I used Larry's code, no error but also no icon appearing. What am I doing wrong. This is the code I use in a form load (login screen).
Any ideas?
Pampers![[afro] [afro] [afro]](/data/assets/smilies/afro.gif)
Keeping it simple can be complicated
I've got the next code in a closed thread by LarrySteele (Programmer) 20 Oct 06 12:11. He gives a function to set the application icon through code.
Access doesn't expose this property for VBA to use. You'll have to append the property if it's not already available, and you determine if the property's available by trapping for error 3270.
Here's a function I've used in the past:
Function ChangeProperty(strPropName As String, varPropType As String, varPropValue As Variant) As Integer
Dim dbs As DAO.Database
Dim prp As DAO.Property
Set dbs = CurrentDb
On Error GoTo PROC_ERROR
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
PROC_EXIT:
On Error Resume Next
Set prp = Nothing
Set dbs = Nothing
Exit Function
PROC_ERROR:
If Err.Number = 3270 Then
Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
ChangeProperty = False
Resume PROC_EXIT
End If
End Function
To use this function to change the icon, I would have the following in my startup procedure:
ChangeProperty "AppIcon", dbText, Access.CurrentProject.Path & "Icon1.ico"
HTH,
Larry
I used Larry's code, no error but also no icon appearing. What am I doing wrong. This is the code I use in a form load (login screen).
Code:
ChangeProperty "AppIcon", dbText, Access.CurrentProject.Path & "daicon.ico"
Any ideas?
Pampers
![[afro] [afro] [afro]](/data/assets/smilies/afro.gif)
Keeping it simple can be complicated