Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Where's my Caption? (2003)

    In Excel I can just use Application.Caption = "blah". How can I set the Caption in Access? I know Tools/ StartUp allows this, but I want to do it programmatically.

    Thanks, Andy.

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Where's my Caption? (2003)

    You can use the following procedure. It requires a reference to the Microsoft DAO 3.6 Object Library.

    Sub SetAppTitle(strTitle As String)
    Dim dbs As DAO.Database
    Dim prp As DAO.Property
    On Error GoTo ErrHandler
    Set dbs = CurrentDb
    Set prp = dbs.Properties("AppTitle")
    prp.Value = strTitle
    RefreshTitleBar
    ExitHandler:
    Set prp = Nothing
    Set dbs = Nothing
    Exit Sub
    ErrHandler:
    If Err = 3270 Then
    Set prp = dbs.CreateProperty("AppTitle", dbText, strTitle)
    dbs.Properties.Append prp
    Resume Next
    Else
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End If
    End Sub

    Call the procedure like this to set the application title (caption) to "Andy":

    SetAppTitle "Andy"

  4. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Where's my Caption? (2003)

    Thank you very much. I thought it would be something straightforward..

    Thanks Andy.

  5. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,536
    Thanks
    0
    Thanked 23 Times in 23 Posts

    Re: Where's my Caption? (2003)

    Hi Hans,
    Where is dbText defined (used in the CreateProperty command) and what is it used for?

  6. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Where's my Caption? (2003)

    Patt

    Look in Help for DAO Constants.

    It just means that the Apptilte property takes a piece of Text.
    Regards
    John



  7. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,536
    Thanks
    0
    Thanked 23 Times in 23 Posts

    Re: Where's my Caption? (2003)

    Sorry i should have let you know i found some code hours ago that does the trick.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •