Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change a form's title bar property (2002, SP3)

    Is there a way when a form is opened to change the form's title bar in code. I have the very same form I want to open if a user makes one of two different choices but I would like the title bar to be different in each case. Can this be done?
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

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

    Re: Change a form's title bar property (2002, SP3)

    The title of a form is its Caption property. You can change it in code, for example in the On Load event of the form, or whenever you like. You can refer in your code to controls on other forms, or you can pass the caption to be used in the OpenArgs argument of DoCmd.OpenForm:

    Code that opens the form:

    DoCmd.OpenForm FormName:="frmMyForm", ..., OpenArgs:="Custom Caption"

    In the On Load event of the form:

    Private Sub Form_Load()
    If Not IsNull(Me.OpenArgs) Then
    Me.Caption = Me.OpenArgs
    End If
    End Sub

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Manassas, Virginia, USA
    Posts
    363
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change a form's title bar property (2002, SP3)

    Thanks a lot for your quick response. That worked perfectly.
    Judy Jones, Computer Training Specialist
    Manassas, Virginia

Posting Permissions

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