473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Setting Application Title

JustJim
407 Expert 256MB
Hi all,

Having done this
Expand|Select|Wrap|Line Numbers
  1. Public Const JMCTITLESTRING As String = "New Arrivals 2008"
and this
Expand|Select|Wrap|Line Numbers
  1.    Set prpTitle = NAdb.CreateProperty("AppTitle", 12, JMCTITLESTRING)
  2.     NAdb.Properties.Append prpTitle
  3.      Application.RefreshTitleBar
I can do this, in the immediate window
Expand|Select|Wrap|Line Numbers
  1. ? currentdb().Properties("AppTitle").value
  2. 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
Feb 22 '08 #1
11 27860
Zwoker
66
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...

Expand|Select|Wrap|Line Numbers
  1. Dim dbs As Database
  2. Set dbs = CurrentDb
  3. dbs.Properties!AppTitle = "Hello World"
  4. Application.RefreshTitleBar
Feb 22 '08 #2
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?
Feb 23 '08 #3
Scott Price
1,384 Expert 1GB
This worked for me using Access 2003... I think you just need to do the .Append method for your new property to work, Jim...

Expand|Select|Wrap|Line Numbers
  1. Dim db As Database
  2. Set db = CurrentDb()
  3. Dim newtitle
  4.  
  5. Set newtitle = db.CreateProperty("AppTitle", dbText, "Test")
  6. db.Properties.Append newtitle
  7. Application.RefreshTitleBar
Regards,
Scott
Feb 23 '08 #4
Scott Price
1,384 Expert 1GB
Actually after looking again, I see that you have used the .Append... Sorry Jim!

Regards,
Scott
Feb 23 '08 #5
missinglinq
3,532 Expert 2GB
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)>
Feb 23 '08 #6
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.
Feb 23 '08 #7
Scott Price
1,384 Expert 1GB
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
Feb 24 '08 #8
JustJim
407 Expert 256MB
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
Feb 25 '08 #9
Scott Price
1,384 Expert 1GB
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;
Expand|Select|Wrap|Line Numbers
  1. Dim db As Database
  2. Set db = CurrentDb()
  3.  
  4. Dim newtitle
  5.  
  6. Set newtitle = db.CreateProperty("Apptitle", dbText, "Test")
  7. 'db.Properties.Append newtitle
  8. db.Properties("AppTitle").Value = "Test"
  9. 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
Feb 25 '08 #10
JustJim
407 Expert 256MB
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;
Expand|Select|Wrap|Line Numbers
  1. Dim db As Database
  2. Set db = CurrentDb()
  3.  
  4. Dim newtitle
  5.  
  6. Set newtitle = db.CreateProperty("Apptitle", dbText, "Test")
  7. 'db.Properties.Append newtitle
  8. db.Properties("AppTitle").Value = "Test"
  9. 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
Feb 25 '08 #11
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).
Expand|Select|Wrap|Line Numbers
  1. Public Sub ChangeAppTitle(strTitle as String)
  2.   Dim proTitle As Property
  3.  
  4.   On Error Resume Next
  5.   With CurrentDB
  6.     Set proTitle = .CreateProperty("AppTitle", dbText, strTitle)
  7.     Call .Properties.Append(proTitle)
  8.     .Properties("AppTitle").Value = strTitle
  9.   End With
  10.   Call Application.RefreshTitleBar
  11. End Sub
Feb 25 '08 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

4
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...
3
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...
8
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
1
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...
4
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"
3
by: John | last post by:
Hi How can I change the application title through code? Thanks Regards
3
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...
6
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 )
1
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 :-
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
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,...
0
Oralloy
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,...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.