Suzanne wrote:
[color=blue]
> What is the code for changing the title in the title bar at the top of the
> screen?
>
> Thanks!
>
> Suzanne
>
>[/color]
You can change this using Tools->Startup.
Thanks, Trevor, but I need to change it with code.
Suzanne
"Trevor Best" <nospam@localho st> wrote in message
news:40808290$0 $23747$afc38c87 @auth.uk.news.e asynet.net...[color=blue]
> Suzanne wrote:
>[color=green]
> > What is the code for changing the title in the title bar at the top of the
> > screen?
> >
> > Thanks!
> >
> > Suzanne
> >
> >[/color]
> You can change this using Tools->Startup.
>
> --
> But why is the Rum gone?[/color]
"Suzanne" <smorrow@earthl ink.net> wrote in
news:kU%fc.1129 2$zj3.10483@new sread3.news.atl .earthlink.net:
[color=blue]
> Thanks, Trevor, but I need to change it with code.
>
> Suzanne
>
>
> "Trevor Best" <nospam@localho st> wrote in message
> news:40808290$0 $23747$afc38c87 @auth.uk.news.e asynet.net...[color=green]
>> Suzanne wrote:
>>[color=darkred]
>> > What is the code for changing the title in the title bar at the top
>> > of the screen?
>> >
>> > Thanks!
>> >
>> > Suzanne
>> >
>> >[/color]
>> You can change this using Tools->Startup.
>>
>> --
>> But why is the Rum gone?[/color][/color]
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)
"Suzanne" <smorrow@earthl ink.net> wrote in message
news:kU%fc.1129 2$zj3.10483@new sread3.news.atl .earthlink.net. ..[color=blue]
> Thanks, Trevor, but I need to change it with code.[/color]
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.
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"
<bouncer@localh ost.not> wrote:
[color=blue]
>
>"Suzanne" <smorrow@earthl ink.net> wrote in message
>news:kU%fc.112 92$zj3.10483@ne wsread3.news.at l.earthlink.net ...[color=green]
>> Thanks, Trevor, but I need to change it with code.[/color]
>
>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
>[/color]
Suzanne wrote:[color=blue]
> Thanks, Trevor, but I need to change it with code.
>[/color]
Option Compare Database
Option Explicit
Declare Function WinAPI_SetWindo wText Lib "user32" Alias
"SetWindowTextA " (ByVal hwnd As Long, ByVal lpString As String) As Long
Declare Function WinAPI_GetParen t Lib "user32" Alias "GetParent" (ByVal
hwnd As Long) As Long
Sub SetWindowText(p strText 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_GetParen t(hwndAccess) = 0
hwndAccess = WinAPI_GetParen t(hwndAccess)
Loop
WinAPI_SetWindo wText hwndAccess, pstrText
End If
Function ChangeTitle(s$)
Dim MyDb As Database, prp As Property
Const conPropNotFound Error = 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.Ref reshTitleBar
Set MyDb = Nothing
Exit Function
ErrorHandler:
If Err.Number = conPropNotFound Error Then
Set prp = MyDb.CreateProp erty("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" <smorrow@earthl ink.net> wrote in message
news:Xf_fc.9087 $l75.8436@newsr ead2.news.atl.e arthlink.net...[color=blue]
> What is the code for changing the title in the title bar at the top of the
> screen?
>
> Thanks!
>
> Suzanne
>
>[/color]
With Application
.Properties("Ap pTitle") = "somethinge lse"
.RefreshTitleBa r
end with
--
Malcolm E. Cook
Stowers Institute for Medical Research
"Suzanne" <smorrow@earthl ink.net> wrote in message
news:Xf_fc.9087 $l75.8436@newsr ead2.news.atl.e arthlink.net...[color=blue]
> What is the code for changing the title in the title bar at the top of the
> screen?
>
> Thanks!
>
> Suzanne
>
>[/color]
Comment