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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application Title 1

Status
Not open for further replies.

rgbanse

MIS
Jun 4, 2001
211
US
From the menu bar I can set the Application Title that will show up in the Toolbar by using Tools/Startup - Application Title: Is there a way to set this value using VBA?
Thx in advance
RGB
 
This code will do it

Call ApplicationTitle("YourNewTitle")

'***Start***
Sub ApplicationTitle(strTitle As String)
Dim intX As Integer
intX = AddAppProperty("Apptitle", dbText, strTitle)
RefreshTitleBar
End Sub

Function AddAppProperty(strName As String, varType As Variant, varValue As
Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo AddProp_Err
dbs.Properties(strName) = varValue

AddAppProperty = True

AddProp_Bye:
Exit Function

AddProp_Err:
If Err = conPropNotFoundError Then
Set prp = dbs.CreateProperty(strName, varType, varValue)
dbs.Properties.Append prp
Resume
Else
AddAppProperty = False
Resume AddProp_Bye
End If
End Function
'***End***
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top