Applecore Pages on Microsoft Access

Changing the caption for a database

If you want to be able to change the caption for the database, rather than for the form (which is achieved through use of the Form's Caption property, normally in the OnCurrent event), then you need to use a database property. If this property doesn't exist, then an error (3270) will be created. Assuming that you have already created a title for the database manually, then the code looks like:

Sub sStartUp()
    Dim strTitle As String
    strTitle = Format(Date, "d, mmmm, yyyy")
    CurrentDb.Properties("AppTitle") = strTitle
    RefreshTitleBar
End Sub

This will then display the current date as the title for the application. Obviously this can be amended, perhaps to display the company name obtained from a lookup table, or the user name, obtained either through Access security being implemented or an API call (GetUserNameA).

Top

 


HOME | NEW | TABLES | QUERIES | FORMS | REPORTS | GENERAL | API | DOWNLOADS | TUTORIAL | RESOURCES
E-MAIL
Copyright & Disclaimer

 

Last modified at 06/06/2006 14:54:30