How to: Give an application its title and icon
Show the application's own name and icon in the Access title bar and on the taskbar, instead of “Access” and the Access icon.
Requires WKL Forms Object Library 1.51 or later.
Solution overview
The title and the icon are startup properties of the database (AppTitle, AppIcon). The
application model keeps them, and the icon file itself is stored in the database (in the
USysWklApp table), so the application doesn't need an icon file next to it. EnsureApplication
writes the stored icon to a file on the computer the application runs on and points AppIcon to
it. The title and the icon take effect immediately.
Implementation
In the application designer (Database Tools › Add-Ins › WKL Application Designer), on the General
page, type the title, click Choose … under Icon file, and select an .ico or .bmp file.
Turn on Icon for forms and reports as well if forms and reports should show the icon too, and
click OK.
In code, for example in a setup routine:
Dim app As Object, model As String
Set app = CreateObject("WklForms.Application")
app.SaveIcon CurrentProject.Path & "\customers.ico"
model = "{ ""version"": 1, ""title"": ""Customers"", ""icon"": ""customers.ico"" }"
Debug.Print app.Save(model) ' AppTitle = Customers (takes effect at once) ...
Remarks
- Only
.icoand.bmpfiles: Access doesn't show any other icon format. A file larger than 1 MB is refused. - The model names the file name, not a path; the file comes from the database.
- Each computer gets its own copy of the icon under
%LOCALAPPDATA%\WKL\<database>, written byEnsureApplicationat startup, becauseAppIconmust name a file on that computer. - An empty title keeps the Access title; the model manages only what it names.