Hi all,
Having done this - Public Const JMCTITLESTRING As String = "New Arrivals 2008"
and this - Set prpTitle = NAdb.CreateProperty("AppTitle", 12, JMCTITLESTRING)
-
NAdb.Properties.Append prpTitle
-
Application.RefreshTitleBar
I can do this, in the immediate window - ? currentdb().Properties("AppTitle").value
-
New Arrivals 2008
Which made me a happy person until I looked at the title bar of the application and it says "Microsoft Access"
Why is it so?
Jim
11 27860
I find that the following example code works fine to change the MS Access title bar. It is a little different that what you show in your code... - Dim dbs As Database
-
Set dbs = CurrentDb
-
dbs.Properties!AppTitle = "Hello World"
-
Application.RefreshTitleBar
NeoPa 32,556
Expert Mod 16PB
In my system AppTitle doesn't even exist :S
I did find "Application.Name" but it's a read-only property (which doesn't surprise me really). Why would you expect this to be a changeable property? Have you seen somewhere that it can be done?
This worked for me using Access 2003... I think you just need to do the .Append method for your new property to work, Jim... -
Dim db As Database
-
Set db = CurrentDb()
-
Dim newtitle
-
-
Set newtitle = db.CreateProperty("AppTitle", dbText, "Test")
-
db.Properties.Append newtitle
-
Application.RefreshTitleBar
Regards,
Scott
Actually after looking again, I see that you have used the .Append... Sorry Jim!
Regards,
Scott
For some reason there are end users that are intimidated by Access while appearing to have no problem with VB6 looking interfaces. Scott’s code changes the app name, but the ever present Access “Key” is still there. One solution that I've used is to create a "background" form that is sized to fill the entire screen, covering the Access window itself. Then you can set the form's name to whatever you want the "application name" to be. There are functions out there for running forms while making the Access Window invisible. I sopent a great deal of time experimenting with these and wasn't at all happy with the results. They work fairly well if your app only involves a single form, but handling multiple forms is a nightmare as all forms have to be popup. I also ran into problems with them closing but leaving the LDB file open, which required shutting the entire system to get rid of.
Linq ;0)> NeoPa 32,556
Expert Mod 16PB
I was being a bit dim.
You created the property AppTitle - hence why I couldn't find it :S
Anyway, after trying Scott's code (and by extension Jim's) in A2003 I found that it did work for me after all. That is, it changed the title for the application as well as updating the property value.
Sorry Jim, I don't know why your's doesnt show.
How are you calling the procedure, Jim?
I piggy-backed it into the On Click event of a button, which of course, only needs to be called once.
The only substantial difference I can see in the two codes (yours and mine) is that you are using a constant of 12 where I used the vbText... Have you tried the other?
Regards,
Scott
How are you calling the procedure, Jim?
I piggy-backed it into the On Click event of a button, which of course, only needs to be called once.
The only substantial difference I can see in the two codes (yours and mine) is that you are using a constant of 12 where I used the vbText... Have you tried the other?
Regards,
Scott
I put the code in the OnOpen event of the form I use as the Main Menu so that it gets run at Application startup.
I'll try the vbText constant (can't remember what 12 was, possibly vbChar)
Thanks all.
Jim
Just a clearup :-) I mistyped the dbText constant as vbText, Jim, Sorry. It should be dbText as I have in the code.
12 is the code for dbMemo. In doing a little testing with NeoPa's help we came up with something that seems to work quite well at changing and re-changing the title when needed. I'll post the updated code here; -
Dim db As Database
-
Set db = CurrentDb()
-
-
Dim newtitle
-
-
Set newtitle = db.CreateProperty("Apptitle", dbText, "Test")
-
'db.Properties.Append newtitle
-
db.Properties("AppTitle").Value = "Test"
-
Call Application.RefreshTitleBar
You'll notice that the .Append line is commented out, it raises an error if called more than once! I.e Access won't allow you to append the same property if it already exists. So the first time the code runs, the new title property needs to be appended, the second time, the .Value needs to be re-set to whatever new title you wish.
The RefreshTitleBar call applies whatever change you have made.
Hope this helps!
Regards,
Scott
Just a clearup :-) I mistyped the dbText constant as vbText, Jim, Sorry. It should be dbText as I have in the code.
12 is the code for dbMemo. In doing a little testing with NeoPa's help we came up with something that seems to work quite well at changing and re-changing the title when needed. I'll post the updated code here; -
Dim db As Database
-
Set db = CurrentDb()
-
-
Dim newtitle
-
-
Set newtitle = db.CreateProperty("Apptitle", dbText, "Test")
-
'db.Properties.Append newtitle
-
db.Properties("AppTitle").Value = "Test"
-
Call Application.RefreshTitleBar
You'll notice that the .Append line is commented out, it raises an error if called more than once! I.e Access won't allow you to append the same property if it already exists. So the first time the code runs, the new title property needs to be appended, the second time, the .Value needs to be re-set to whatever new title you wish.
The RefreshTitleBar call applies whatever change you have made.
Hope this helps!
Regards,
Scott
Yes, I didn't actually explain the details but I had the append in the main code and trapped the error to make the change if the property had allready been appended.
This has been fun and educational. I'm going to have to wait until I get home to play with it.... my USB key just now fell to pieces as I went to put it in the socket!
Thank you to all who assisted.
Jim
NeoPa 32,556
Expert Mod 16PB
Some alternative code, that handles either occasion using "On Error ...". Remember that once this property has been added to an application installation (not db or user dependent), it is not removable (at least we found no way & I searched the Registry). To restore it you'd need to set it back to "Microsoft Access" (as I had to do after my testing). - Public Sub ChangeAppTitle(strTitle as String)
-
Dim proTitle As Property
-
-
On Error Resume Next
-
With CurrentDB
-
Set proTitle = .CreateProperty("AppTitle", dbText, strTitle)
-
Call .Properties.Append(proTitle)
-
.Properties("AppTitle").Value = strTitle
-
End With
-
Call Application.RefreshTitleBar
-
End Sub
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tim Jarman |
last post by:
Apologies in advance for the long post - I wanted to be sure I included all
the relevant details. The answer is probably very, very simple.
I am doing something stupid here, but I don't know what...
|
by: wolftor |
last post by:
If I change the application title, it appears to change OK during the
current session; but if I exit Access 97 and then run the application again,
the change did not get saved. Any idea how to fix...
|
by: Suzanne |
last post by:
What is the code for changing the title in the title bar at the top of the
screen?
Thanks!
Suzanne
|
by: Paul |
last post by:
I have a .mdb that I did not write. I open the app and change the
Application Title in the Startup dialog box. The bar at the top
changes to what I want typed in. I close the app. When I open...
|
by: Daniel Morrissey |
last post by:
Why will the following code not change the window title of the new window?
window.open "Default.htm" ,"YO"
|
by: John |
last post by:
Hi
How can I change the application title through code?
Thanks
Regards
|
by: Andre Ranieri |
last post by:
Hello,
I would certainly appreciate some feedback to the issue I'm experiencing in
my first major WMI application. When I navigate to a new child form I
usually dispose of the one I'm...
|
by: vijai.kalyan |
last post by:
Hello,
I wrote a trivial program to set the console title in a console
application. Here is the code:-
namespace myns
{
class SetTitle
{
static void Main ( string args )
|
by: indirareddy |
last post by:
Hai ...
I Did One Project Without Title . How To Applied Title Name .
Note :- I Have Using Master Page
it is possible to write title in Default .aspx
Example :-
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |