Application Title Bar

theprez

Registered User.
Local time
Today, 19:37
Joined
Nov 8, 2001
Messages
140
Can you use VB to set the Application Title Bar? I have looked at the SetOption code, but do not see anything for Application Title Bar.
 
Sure you can. Check the Help files for the AppTitle Property.

SetProperties "AppTitle", dbText, "My Custom Application"

HTH
 
Thank you. I will try this.
 
I am developing in Access XP but keep A97 around for sanity. In this case, I changed the Application Title in XP Tools/Startup but when I open the dB, brackets ([]) are added at the end.

Rooting around, I found VBA code to change the title. But this is also causing these []s to appear. The title I am attempting to enter has a period and comma but I don't think that is it. I used my name as the title and got the same []s.

This does not occur in A97. Does anyone have thoughts on this?
 
Override The Applications Title - [No Form Title]

Try this to remove the [brackets].
Code:
'Copy this into a public module
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long

Public Sub SetFormTitle(frm As Form, TitleText As String)
    Dim fhWnd As Long
    fhWnd = frm.hwnd
    SetWindowText fhWnd, TitleText
End Sub

Public Sub SetAppTitle(TitleText As String)
    SetWindowText Application.hWndAccessApp, TitleText
End Sub

'Copy this into the the forms OnOpen event
Private Sub Form_Open(Cancel As Integer)
    SetFormTitle Me, ""
    SetAppTitle "My Application Title Here"
End Sub

Courtesy of Larry Steele
HTH
 
Ghudson thanks for your reply! Sorry to take so long.

I got a compile error in the Private Function that was 'fixed' when I removed the 2nd ByValue in the arguments. I'm not sure this is right. But with this change and adding the two module sub-procedures, the code does run. But it returns the application title bar back to "Access []" when opening the program with the SHIFT key and to the "My Application Title Here []" when I do not use the SHIFT key.

On other dBs in AccessXP I am not getting any brackets in the title.

I'll keep looking around. The fact that other XP dBs are not displaying brackets [] in the title bar indicates to me that I have something else wrong.
 

Users who are viewing this thread

Back
Top Bottom