[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

How to show the database name first in the Access window caption in the taskbar?

Ok, the problem is: in the Access 2003, when you opened a database, in the taskbar you would be shown “MyDatabaseName: Database”, and if you would have opened a table, it would be shown “MyTableName: Table”, so if you have several databases opened, you would get instant overview where is each one just by glancing at the taskbar.

In the Assess 2010 (I suppose 2007 too) however, when you open a database, you get “Microsoft Access – MyDatabaseName: Database” as the caption in the taskbar, but, due to a finite length of the window caption in the taskbar (XP, or Win 7 with “Never Combine Taskbar buttons” option enabled), the actual caption in the taskbar is trimmed to “Microsoft Access…”; and now if you have opened multiple databases, you have a bunch of “Microsoft Access…” windows, without  that instant overview to what database each of them refer, unless you hover the mouse in the taskbar…

I really would like to know in what state of mind was the person in MS who thought that this change was a good change. Nevertheless, the question now is how to change this behavior to a previous one, or a similar one, so that in the taskbar is shown the database file name first?

I have found that  if you set File>Options>Current Database>Application Title, to e.g. Application Title=MyTitle, it would be shown MyTitle in the taskbar, which is ok, however, I don’t want to have to manually have to change the current database Application title for each and every db I open… so alternatively, the question could be: is there a way to tell access to automatically as the Application Title use the current database file name? And if there is no such an option, and Add-In to automatically do that would be also ok I suppose…
0
npaun
Asked:
npaun
  • 5
  • 3
  • 3
  • +1
1 Solution
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
That option is database-specific, so you'd have to change it for each database.

There is no add-in available to do these things, but it's a one-time change for existing databases, and you can set this option prior to deployment for new databases.
0
 
Gustav BrockCIOCommented:
You can call this sub:

Public Sub CreateTitle()

    Dim prp     As Property
   
    On Error Resume Next
    Set prp = CurrentDb.CreateProperty("AppTitle", dbText, Split(CurrentProject.Name, ".")(0))
   
    CurrentDb.Properties.Append prp
   
    Set prp = Nothing

End Sub
0
 
npaunAuthor Commented:
@Scott McDaniel
Thank you for the comment.
I'm not quite sure what did you mean by "you can set this option prior to deployment for new databases."?
The point is, I have A LOT of existing databases (1000+), with various names, which I have to open several at the time, and it is not a solution for me to change the Application Title for every db... I would need that Access simply use the database name automatically as the App Title... or some other approach where the db name would be shown first in the  window caption in the taskbar....
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
npaunAuthor Commented:
@Gustav Brock
Thanks.
As a macro? Hm, 'll try... but, again, it would mean manually running a macro for each and every opened db... Better than having to manually change the AppTitle in the options, but worse than having an add-in which would do it automatically when a db is opened...
0
 
Gustav BrockCIOCommented:
Well, you could replace CurrentDb with a variable db, then loop through your folders and 1000s of files, pick the file names, and pass these to:

    Dim dbs     As DAO.Database
    Set dbs = DAO.OpenDatabase(FileName)

and:

    Set prp = CurrentDb.CreateProperty("AppTitle", dbText, Split(FileName, ".")(0))

/gustav
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
The point is, I have A LOT of existing databases (1000+), with various names, which I have to open several at the time
Then Gustav's solution would seem to be the best choice.

Even with an Add-in, you'd have to open each database and "enable" that add-in - so you're back to square one. At some point, you will have to open and set that property for each database. You can do so manually, or you can use Gustav's code suggestion to loop through your databases and set it from code.
0
 
npaunAuthor Commented:
yes, probably...
The remaining problems is, that that bunch of databases is not fixed, i.e. than can still be created, or renamed, and also, they are not in a specific place (one folder), but on various places... I, even if  I make a program to scan the entire system, soon it could/would become uncompleted... I would need to very often run the program to maintain AppTitle up to date for each very db... viable, although cumbersome and inelegant, for something that MS should make trivial...
0
 
npaunAuthor Commented:
@Scott
PS: In a case of such an add-in, shouldn't ad-in be able to autostart when Access is loaded?
0
 
Gustav BrockCIOCommented:
> .. shouldn't ad-in be able to autostart when Access is loaded?

I don't think that is possible.

/gustav
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I don't deal with Addins much, but it would seem to be a HUGE security hole in Access if you could automatically start an AddIn without the user first opening the database and enabling that Addin for each database. But, again, I don't use them, so the behavior you want may be available.

for something that MS should make trivial...
I'm not sure I agree with that, but to each is own I suppose. It's quite apparent that MSFT is not doing anything further with the desktop environment (look at the direction Access has gone in the past few versions).
0
 
npaunAuthor Commented:
@Scott
regarding "for something that MS should make trivial...", I meant regarding for an option to be able to use db file name as the Application Title, or at least leave to the option to show the Access window caption in the previoos format db file name first, and not to broke small but a useful behavior by pointlessly putting "Microsoft Access" first for every window caption. It is my honest opinion as a user. Not meant "MS should make autostart of add-ins trivial", in that I could agree with you, and in that respect MS of course would have my full support to do as prudent as it would consider...
0
 
PatHartmanCommented:
really would like to know in what state of mind was the person in MS who thought that this change was a good change.
I ask myself that frequently since the advent of A2007.  It seems that each new version is created by a person who has never even seen previous versions of Access and so they change random things, usually for the worse.  I could give you a dozen stupid, mindless changes that make Access less "accessible" than it was before.  Sorry, I had to rant.

Best practice would be to always give the database a name when you create it.  Of course that doesn't help you with the "1000's" you have to open although Gus' code will go a long way toward assigning names to existing databases.  But if you don't mind an observation, if you are opening "1000's", you are almost certainly dealing with "spreadsheets" rather than databases and that is the true problem.  Rectifying that would be the best use of your time.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now