I am attempting to update the Application title bar using vba to update the app title based on data in a table. It seems to lag behind and at times be completely wrong. The code is below.
The dlookup function checks a linked table to see if the field value of [isrunning] is true.
If it is, Access should display one title, if it's false another. The function is called whenever a form is opened and from an AUTOEXEC macro at startup.
Note: the startup macro seems to be the only time it even partially works.
Public Function update_title_bar()
Dim db As Database, app_title As String
Set db = CurrentDb
If DLookup("isrunning", "tbl_base_status") = True Then
app_title = "Client - Online"
app_title = "Client****OFFLINE****"
db.Properties("AppTitle").Value = app_title