Application Name

F

Franco

Hi. usually we can define the application-name on the 'initialize' form. i
want to change the application name (the caption displayed on the blue
headline) at runtime. (like: My.application.caption + User:
actual.user.name). Is this possible?
How can i do that.

Thanks a lot

Franco
 
G

Graham Mandeno

Hi Franco

Assuming you already have a non-standard title bar (not "Microsoft Access")
you can say:
CurrentDb.Properties("AppTitle") = "My Application - " & CurrentUser()
Application.RefreshTitleBar

If a custom title bar has never been created, then you must use
CreateProperty to create the AppTitle property in the first place.
 
K

Klatuu

You don't need to create any properties. This is what you need:

CurrentDb.Properties("AppTitle") = "MyAppName" & CurrentUser()
 
G

Graham Mandeno

Hi Klatuu

AppTitle is not a native property of the DAO.Database object. Therefore, if
you create a new MDB, open the immediate window, and type:

CurrentDb.Properties("AppTitle") = "x"

you will get error 3270 (property not found).

So you DO need to create the property first, either using CreateProperty in
code, or manually using the Tools>Startup dialog box.

Also, if you want the new titlebar to be displayed without closing and
reopening the database, you must refresh it:

Application.RefreshTitleBar
 
K

Klatuu

You are correct; however, I was keying on the OP's statement:
change the application name

That would imply one exists.
I did forget about the Application.RefreshTitleBar, sorry.

But, in any case, rather than deaing with a coding issue to establish the
property, I would suggest using the initial Title set up in the startup
options dialog to put in any value (doesn't matter), then this would set it
to what the OP wants.

CurrentDb.Properties("apptitle") = "MyNewApp - " & CurrentUser()
Application.RefreshTitleBar

I would suggest it be the first lines of code executed.

Graham Mandeno said:
Hi Klatuu

AppTitle is not a native property of the DAO.Database object. Therefore, if
you create a new MDB, open the immediate window, and type:

CurrentDb.Properties("AppTitle") = "x"

you will get error 3270 (property not found).

So you DO need to create the property first, either using CreateProperty in
code, or manually using the Tools>Startup dialog box.

Also, if you want the new titlebar to be displayed without closing and
reopening the database, you must refresh it:

Application.RefreshTitleBar
--
Cheers!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Klatuu said:
You don't need to create any properties. This is what you need:

CurrentDb.Properties("AppTitle") = "MyAppName" & CurrentUser()
 
Top