Results 1 to 5 of 5
  1. #1
    raphaelbm is offline Novice
    Windows 10 Access 2021
    Join Date
    Aug 2025
    Location
    Reading UK
    Posts
    2

    Can I set Access Application Title programmatically?

    Can I set Access Application Title programmatically?


    I would like to code =Left([CurrentProject].[Name],InStrRev([CurrentProject].[Name],".")-1)


    That will give me the filename as the Title.


    It is a pain having to type it manually for each new database.
    Thanks for looking. Raphael
    Attached Thumbnails Attached Thumbnails set Access Application Title 2025-08-02_19-00-46.jpg  

  2. #2
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,880
    Pass the new title to this sub

    Code:
    Sub SetNewAppTitle(NewTitle As String)
    
        On Error GoTo SetNewAppTitle_Error
        
        CurrentDb.Properties("AppTitle") = NewTitle
    
        Application.RefreshTitleBar
        
    Exit_Sub:
        Exit Sub
    
    SetNewAppTitle_Error:
    
        If Err.Number = 3270 Then ' Property not found
            CurrentDb.Properties.Append CurrentDb.CreateProperty("AppTitle", dbText, NewTitle)
            Application.RefreshTitleBar
        Else
            MsgBox "Error setting application title: " & Err.Description, vbCritical
        End If
            
        Resume Exit_Sub
        
    End Sub
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  3. #3
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Just to explain part of Moke's code

    The AppTitle property does not exist until it is created either in Options | Current Database or using code
    For that reason, the code needs to trap for error 3270 which is triggered when the property doesn't exist.

    The same applies to the AppIcon property.
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,570
    Supplies a solution in a 9 year old thread for same issue, then asks the question?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    The other thread was asking about pulling application title into a report header.

    This one wants to assign title to the application.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 08-03-2025, 08:38 PM
  2. how to set application title & logo in code?
    By uoghk in forum Programming
    Replies: 6
    Last Post: 09-30-2022, 03:20 AM
  3. Replies: 6
    Last Post: 04-06-2022, 09:22 AM
  4. Replies: 5
    Last Post: 08-03-2016, 04:36 AM
  5. Replies: 2
    Last Post: 03-20-2015, 06:30 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums