Changing Apllication title in ADP project

  • Thread starter Thread starter Jonathan Blitz
  • Start date Start date
J

Jonathan Blitz

I am trying to change the application title of my project.

This is my code:


Public Sub ChangeProjectTitle()
Dim obj As Object
Dim dbs As Object
Const conPropNotFoundError = 3270

On Error GoTo ErrorHandler
' Set dbs = CurrentDb
' Change title bar.
CurrentProject.Properties!AppTitle = "My Title" ' Update title bar on
screen.
Application.RefreshTitleBar
Exit Sub

ErrorHandler:
If Err.Number = conPropNotFoundError Then
Set obj = CurrentProject.CreateProperty("AppTitle", "X", "My Title")

CurrentProject.AccessObjectProperties.Add obj
Else
MsgBox "Error: " & Err.Number & vbCrLf & Err.Description
End If
Resume Next
End Sub

However, I am not gettng the conPropNotFoundError error. Instead I am
getting error number 2445: ""You entered an expression that has an invalid
reference to the property 'AppTitle'.""

I tried adding that to the IF statement but then I get an error on the
CreateProperty command: 438 - Object doesn't support this property or
method"

What am I doing wrong?

Jonathan Blitz
 
I've got to admit that I'm not certain whether this effects anything or not,
but

CurrentProject.Properties!AppTitle = "My Title"

should probably read:

CurrentProject.Properties.AppTitle = "My Title"

or

CurrentProject.Properties("AppTitle") = "My Title"
 
Back
Top