Sabtu, 07 April 2012

RE: [MS_AccessPros] Change Application Title

 

Son-

At first, I thought it might be a setting with SetOption, but it's actually a
property of your database. You can set the title like this:

First, put this code in a Standard module:

--------------------------------------------
Public Sub SetStringProperty(dbsTemp As DAO.Database, strName As String, _
strSetting As String)

Dim prpNew As Property
Dim errLoop As Error

' Attempt to set the specified property.
On Error GoTo Err_Property
dbsTemp.Properties("strName") = strSetting
On Error GoTo 0

Exit Sub

Err_Property:

' Error 3270 means that the property was not found.
If DBEngine.Errors(0).Number = 3270 Then
' Create property, set its value, and append it to the
' Properties collection.
Set prpNew = dbsTemp.CreateProperty(strName, _
dbText, strSetting)
dbsTemp.Properties.Append prpNew
Resume Next
Else
' If different error has occurred, display message.
For Each errLoop In DBEngine.Errors
MsgBox "Error number: " & errLoop.Number & vbCr & _
errLoop.Description
Next errLoop
End
End If

End Sub

-----------------------------

Then use this code to set the application title:

----------------------------
Dim db As DAO.Databse

Set db = CurrentDb
SetStringProperty db, "AppTitle", "My Custom Title"
Application.RefreshTitleBar

--------------------------------

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

----------------------------------------------------------

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Watson L
Sent: Saturday, April 07, 2012 6:03 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Change Application Title

 
Dear all,

How to change the application title in ms. access xp/2003 by coding? So I can
type the application title in a table.. Please assist me.. Thx

best regards,

son

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___

Tidak ada komentar:

Posting Komentar