Application Name!

NigelShaw

Registered User.
Local time
Today, 10:06
Joined
Jan 11, 2008
Messages
1,575
Hi,

probably a dumb question but something i havent really done before......

im guessing that i can set the application name ( found in the current database settings ) as a property in vba? Does anybody have an example?



thanks


Nigel
 
If I want to know about the properties of something I sometime enumerate them in a loop and that usually reveals what I a looking for.
 
If I want to know about the properties of something I sometime enumerate them in a loop and that usually reveals what I a looking for.

Hi G

Happy New Year!

I don't suppose you have an example to hand that you could post at all do you? I'm away from my office until 4th Jan and my code is stored there :(


Don't worry if not mate



Cheers

Nidge
 
Hi

Title bar isn't the problem my friend, it's the applicationName property I'm looking for. I can't get the link to work either mate :)


Cheers

N
 
Ok,


In MSDN I searched for ..

Changing and Resetting Text in the Access 2007 Title Bar

This brings up an article on changing the AppTitle property using VBA.


ETA: Oh darn, you're looking for AppName not AppTitle. I must need new glasses.
 
CurrentDb.Properties("AppTitle")

It is not exposed in dot syntax. There are a number of these that hide in the Properties Collection of some objects. They can be quite elusive because they don't show up in the Object Browser.

Code:
Sub EnumerateCurrentDbProps()
 
Dim prpty As Property
 
   For Each prpty In CurrentDb.Properties
      Debug.Print prpty.Name
   Next
 
End Sub
 
Oh things have moved on while I was looking at code. If AppTitle is not it then I am confused what you are looking to change.

You can't change CurrentProject.Name because that is the name of the file itself and would require renaming an open file.
 
Right,

After a bit of looking up, and playing, I have come up with this which seems to work (In Access 2010 anyway).


Code:
Public Function changeAppName(ByVal newAppName As String)
Dim newTitle
On Error Resume Next

' Look to see if the Property AppTitle already exists
changeAppName = ""
changeAppName = CurrentDb.Properties("AppTitle").Value

If changeAppName = "" Then
' If not then append it to the Database Properties
    Set newTitle = CurrentDb.CreateProperty("AppTitle", dbText, newAppName)
    CurrentDb.Properties.Append newTitle

Else
' If it does then change the value in the Database Properties

    CurrentDb.Properties("AppTitle").Value = newAppName

End If

Application.RefreshTitleBar
End Function

I hope this helps.

ETA: Gracious I AM being thick today. It's still the Title. Arrggghhh! :eek:


The only other thing I can find is Application.Name which gives Microsoft Access but why would you want to change that? :confused:
 
Last edited:
Application.Name is "Microsoft Access".

Surely you don't expect to be able to change that?
 
Hi Guys,

yes its the AppTitle. Im probably being stupid today lol!

i want hte name of the app to show in the taskbar icon which is the Application Name in the Current Database settings which should be AppTitle


Cheers Peeps :)



nidge
 
Doh! Then the code in my post 9 might help after all.

I enabled the labels in the task bar (of Windows 7) and the Access App I tinkered with earlier showed the New Title instead of Microsoft Access...

BTW, any particular reason that you don't just change it in the Options?
 
Hi,

yes. the settings are passed to another db as part of my tool. a shortcut is created and the icon is set in the properties so i wanted to change the AppTitle too so they both were the same i.e. Shortcut name & Taskbar title


Cheers


Nigel
 

Users who are viewing this thread

Back
Top Bottom