Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / December 2007

Tip: Looking for answers? Try searching our database.

Application Title Bar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JimS - 04 Dec 2007 14:55 GMT
I know you can set the application title in the Startup dialog box, but I'd
like to do it programatically using VBA in my Startup form. Anybody know how?
Signature

Jim

Allen Browne - 04 Dec 2007 15:17 GMT
Provided some title has been set, use:
   currentdb.Properties("AppTitle") = "Hello World"
   Application.RefreshTitleBar

If the property does not exist, you need to create it.
The SetPropertyDAO() function in this link will set the property, creating
it if needed:
   http://allenbrowne.com/AppPrintMgtCode.html#SetPropertyDAO

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I know you can set the application title in the Startup dialog box, but I'd
> like to do it programatically using VBA in my Startup form. Anybody know
> how?
bnkari - 04 Dec 2007 15:28 GMT
This is code from one of my applications.  Straight from Access Help.  You
can enter this directly into a module.  Pass the variable (in this case
'PilotName') and it should update your title bar.  You can obviously edit the
code to suit your needs.  Hope this helps, and let me know if you have any
questions.

Sub ChangeTitle(PilotName As String)
   Dim obj As Object
   Dim dbs As DAO.Database
   Const conPropNotFoundError = 3270
   
   On Error GoTo ErrorHandler
   ' Return Database object variable pointing to
   ' the current database.
   Set dbs = CurrentDb
   ' Change title bar.
   dbs.Properties!AppTitle = PilotName & " Pilot Log Book"
   ' Update title bar on screen.
   Application.RefreshTitleBar
   Exit Sub
   
ErrorHandler:
   If Err.Number = conPropNotFoundError Then
       Set obj = dbs.CreateProperty("AppTitle", dbText, PilotName & " Pilot
Log Book")
       dbs.Properties.Append obj
   Else
       MsgBox "Error: " & Err.Number & vbCrLf & Err.Description
   End If
   Resume Next
End Sub

>I know you can set the application title in the Startup dialog box, but I'd
>like to do it programatically using VBA in my Startup form. Anybody know how?
JimS - 04 Dec 2007 15:40 GMT
Thank you both for your fine answers. I've solved the problem!

Thanks again!
Signature

Jim

> This is code from one of my applications.  Straight from Access Help.  You
> can enter this directly into a module.  Pass the variable (in this case
[quoted text clipped - 30 lines]
> >I know you can set the application title in the Startup dialog box, but I'd
> >like to do it programatically using VBA in my Startup form. Anybody know how?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.