By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,404 Members | 1,873 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,404 IT Pros & Developers. It's quick & easy.

Application Title

P: n/a
What is the code for changing the title in the title bar at the top of the
screen?

Thanks!

Suzanne
Nov 12 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Suzanne wrote:
What is the code for changing the title in the title bar at the top of the
screen?

Thanks!

Suzanne

You can change this using Tools->Startup.

--
But why is the Rum gone?
Nov 12 '05 #2

P: n/a
Thanks, Trevor, but I need to change it with code.

Suzanne
"Trevor Best" <nospam@localhost> wrote in message
news:40***********************@auth.uk.news.easyne t.net...
Suzanne wrote:
What is the code for changing the title in the title bar at the top of the
screen?

Thanks!

Suzanne

You can change this using Tools->Startup.

--
But why is the Rum gone?

Nov 12 '05 #3

P: n/a
"Suzanne" <sm*****@earthlink.net> wrote in
news:kU*******************@newsread3.news.atl.eart hlink.net:
Thanks, Trevor, but I need to change it with code.

Suzanne
"Trevor Best" <nospam@localhost> wrote in message
news:40***********************@auth.uk.news.easyne t.net...
Suzanne wrote:
> What is the code for changing the title in the title bar at the top
> of the screen?
>
> Thanks!
>
> Suzanne
>
>

You can change this using Tools->Startup.

--
But why is the Rum gone?


I suspect that there is a much easier way than this:

Private Declare Function SetWindowText Lib "user32" _
Alias "SetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String) As Long

Public Sub DisplayAppTitle(ByVal Title As String)
SetWindowText hWndAccessApp, Title
End Sub
--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #4

P: n/a

"Suzanne" <sm*****@earthlink.net> wrote in message
news:kU*******************@newsread3.news.atl.eart hlink.net...
Thanks, Trevor, but I need to change it with code.


Changing the Application's title in the bar at runtime is pretty
non-standard practice in Windows, and Windows' consistency is its strong
point.

What's displayed there is the Application's Name property but it is
read-only at runtime.

I'm sure, with a little research, you will find an API that you can use to
accomplish this, if you really have a need.

Perhaps you might consider some other way to accomplish the same purpose.

Larry Linson
Microsoft Access MVP
Nov 12 '05 #5

P: n/a
The VB code is here:
http://support.microsoft.com/default...b;en-us;210169

If memory serves, some automation functions (like opening Word and
passing data from an Access application) don't work unless the
application title is 'Microsoft Access'.

So if you change the application title, you have to switch it to
'Microsoft Access' before calling Word then set it back to your custom
title when done.

This was true of Access 97, don't know about later versions.

- Brian

On Sat, 17 Apr 2004 02:15:05 GMT, "Larry Linson"
<bo*****@localhost.not> wrote:

"Suzanne" <sm*****@earthlink.net> wrote in message
news:kU*******************@newsread3.news.atl.ear thlink.net...
Thanks, Trevor, but I need to change it with code.


Changing the Application's title in the bar at runtime is pretty
non-standard practice in Windows, and Windows' consistency is its strong
point.

What's displayed there is the Application's Name property but it is
read-only at runtime.

I'm sure, with a little research, you will find an API that you can use to
accomplish this, if you really have a need.

Perhaps you might consider some other way to accomplish the same purpose.

Larry Linson
Microsoft Access MVP


Nov 12 '05 #6

P: n/a
Suzanne wrote:
Thanks, Trevor, but I need to change it with code.


Option Compare Database
Option Explicit
Declare Function WinAPI_SetWindowText Lib "user32" Alias
"SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
Declare Function WinAPI_GetParent Lib "user32" Alias "GetParent" (ByVal
hwnd As Long) As Long

Sub SetWindowText(pstrText As String)
Dim hwndAccess As Long

If Forms.Count = 0 Then
MsgBox "I need a form open to do this as I need " & _
"it's window handle"
Else
hwndAccess = Forms(0).hwnd
Do Until WinAPI_GetParent(hwndAccess) = 0
hwndAccess = WinAPI_GetParent(hwndAccess)
Loop
WinAPI_SetWindowText hwndAccess, pstrText
End If

End Sub

--
But why is the Rum gone?
Nov 12 '05 #7

P: n/a
A long time ago I think this worked

Function ChangeTitle(s$)
Dim MyDb As Database, prp As Property
Const conPropNotFoundError = 3270

On Error GoTo ErrorHandler
' Return Database object variable pointing to
' the current database.
Set MyDb = CurrentDb
' Change title bar.
MyDb.Properties!AppTitle = s
' Update title bar on screen.
Application.RefreshTitleBar

Set MyDb = Nothing
Exit Function

ErrorHandler:
If Err.Number = conPropNotFoundError Then
Set prp = MyDb.CreateProperty("AppTitle", dbText, MyDb.Name)

MyDb.Properties.Append prp
Else
MsgBox "Error: " & Err.Number & vbCrLf & Err.Description
End If
Resume Next
End Function

HTH

Phil
"Suzanne" <sm*****@earthlink.net> wrote in message
news:Xf*****************@newsread2.news.atl.earthl ink.net...
What is the code for changing the title in the title bar at the top of the
screen?

Thanks!

Suzanne

Nov 12 '05 #8

P: n/a
With Application
.Properties("AppTitle") = "somethingelse"
.RefreshTitleBar
end with
--
Malcolm E. Cook
Stowers Institute for Medical Research

"Suzanne" <sm*****@earthlink.net> wrote in message
news:Xf*****************@newsread2.news.atl.earthl ink.net...
What is the code for changing the title in the title bar at the top of the
screen?

Thanks!

Suzanne

Nov 12 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.