Senin, 09 April 2012

[MS_AccessPros] Re: Change Application Title

 

Hi John, Son,

Normally the Db AppTitle property can be made available
by using,

Access2003: Tools/Startup
Access2007: OfficeButton/AccessOptions
Access2003/2007 VBA:
docmd.RunCommand acCmdStartupProperties
or John's code example.

In a new DB the Startup Properties group is created
when one of the first three methods is used, and the
default values are then assigned.

Access2007 has a few moreStartup properties than Access2003.

Regards, Clive.

--- In MS_Access_Professionals@yahoogroups.com, John Viescas <JohnV@...> wrote:
>
> 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