Question : Access: Embed Application Icon

Normally I go to "Tools-->Startup" and select destination for the application icon. If the icon moves, it changes to the Access logo again. Is there a way to embed the icon into the program, so that if the icon moves, the logo I made will remain (Instead of the Access logo.)

Answer : Access: Embed Application Icon

You will need this function to set the property is it doesn't exist:

Public Function SDB_SetProperty(argPrpName As String, argPrpType, argPrpVal)
   
    On Error GoTo SDB_SetProperty_Error
   
    Dim prp As Property
    CurrentDb.Properties(argPrpName) = argPrpVal
    SDB_SetProperty = True
   
SDB_SetProperty_Exit:
    On Error Resume Next
    Set prp = Nothing
    Err.Clear
    Exit Function

SDB_SetProperty_Error:
    If Err.Number = 3270 Then   'Property not found
        Set prp = CurrentDb.CreateProperty(argPrpName, argPrpType, argPrpVal)
        CurrentDb.Properties.Append prp
        SDB_SetProperty = True
    Else
        MsgBox "Some Other Error" & Err.Number & " " & Err.Description
    End If
    Resume SDB_SetProperty_Exit

End Function

Then this to set the icon:

    Call SDB_SetProperty("AppIcon", dbText, "SomeFolder\YourIcon.bmp")
    Application.RefreshTitleBar

mx
Random Solutions  
 
programming4us programming4us