Application Name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
You don't need to create any properties. This is what you need:

CurrentDb.Properties("AppTitle") = "MyAppName" & CurrentUser()
 
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
 
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()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top