Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database name on title bar

Status
Not open for further replies.

marcondes

Technical User
Feb 20, 2002
23
0
0
US
I'm trying to display my database file name on the title bar of my forms and reports. The reason, is because I want the captions to change according to the versions I'm creating, not having to change the caption on the forms one by one. It would be nice also if I could have the CurrentUser value displayed as well.

Thanks
 
To change the name displayed in the title bar - open the report/form in desing view -> view the report/form properties and change the Caption property to the name you want displayed.

HTH,
JC
 
Go to Tools | Startup... and type the name you want in the "Application Title:" text box.
 
I want to be able to have something like "=DatabaseName()" in the Caption field. So whenever I change the file name from "DataPro 1.5" to "DataPro 1.6" it automatically changes the title bar for all my forms.
Thanks
 
Forms have CAPTIONS - and the only way I can see to change them all is to set them to the value of a globally-accessable FUNCTION that returns some string (e.g. the database name) , and set the caption in the form's ON LOAD event.

You can hard-code the database name, I suppose, in the function itself:

Function MyCaption() as string
MyCaption = "DataPro 1.5"
End Function

Form Caption setting:

Sub Form_Load
me.Caption = " Current Database is " & MyCaption
End sub

Should be all you need - just tested it, works fine...

Jim





How many of you believe in telekinesis? Raise my hand...
Another free Access forum:
More Access stuff at
 
To expand on Jim's post:

Add the Version and CurrentUser variables to the form_load event:
Code:
Private Sub Form_Load()
Me.Caption = MyCaption & " " & Me.Application.CurrentDb.Version & " " & Me.Application.CurrentUser
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top