Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Mar 2002
    Location
    USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Database Name in Title Bar (All)

    I regularly send out Access subsets of large SQL Server databases to our users, the subsets and sql databases have the same name but are stored in different subdirectories. When I'm testing I need to be able to distinguish which of the databases I'm looking at in the Access UI.

    What would be a great help is if there were a way to make Access display the full path of the database file in the title bar of the Access window. Is there a way to do this?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Database Name in Title Bar (All)

    If you want the path of the current db in the title bar use :
    <pre>CurrentDb.Properties("AppTitle") = CurrentDb.Properties("Name")</pre>


    If you want the path to a linked database, you'll have to get it in the MSysObjects table.
    <pre>CurrentDb.Properties("AppTitle") = Dlookup("Database","MSysObjects","[Name] = 'LinkedTable'")</pre>

    Replace LinkedTable with the name of one of your linked tables.
    Francois

  3. #3
    New Lounger
    Join Date
    Mar 2002
    Location
    USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Database Name in Title Bar (All)

    Thanks Francois, but that's not exactly what I'm looking for.

    I need a setting within Access itself that forces the directory path to be displayed in the database window's title. e.g. if the open database is fapdb and is stored at g:fapfap2002uaf the title should be g:fapfap2002uaffapdb.

    I'm using a standalone VB program to work with the database, not embedded VBA code, so I don't know exactly know where to put the code you included. I looked for a macro that would fire when the database was opened, but couldn't find one. I tried creating a module, but I'm not very familiar VBA.

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Database Name in Title Bar (All)

    In the database window, select Tools | Startup.
    Enter anything you want,in the Application Title box, it does matter what.
    Put the following function in a module.
    <pre>Function FillApplTitle()
    CurrentDb.Properties("AppTitle") = CurrentDb.Properties("Name")
    RefreshTitleBar
    End Function</pre>

    Create a Macro, named Autoexec, with
    RunCode in the Action Column
    FillApplTitle() in the Function Name box.
    Francois

  5. #5
    New Lounger
    Join Date
    Mar 2002
    Location
    USA
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Database Name in Title Bar (All)

    Thanks Francois!!!

    You are an absolute genius. I've been trying to figure that out since Access 95!!

    Thanks!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •