• Form Title Bar (Access 2000)

    Author
    Topic
    #378918

    I would like to have the first name and last name field come up on the title bar of a form after (or as) they are typed in. These fields are combo boxes. I couldn’t figure out an expression to put in caption property or even if that property would take expressions.
    Thanks

    Jodi

    Viewing 1 reply thread
    Author
    Replies
    • #628998

      Jodi.

      If you want the caption of the form to change as you are typing in the two combos you need to add the following line of code to the change event of both first name and last name combos:

      Me.Caption = cboFirstName.Text & ” ” & cboLastName.Text

      If you just want it to change after the combos have been updated, add the line of code to the AfterUpdate event of both combos.

    • #629002

      You would need code to change the caption of the form in:

      • The OnCurrent event of the form, and
      • The AfterUpdate event of the combo boxes if you want to change the caption after the user has typed/selected a name, or
      • The OnChange event of the combo boxes if you want to change the caption as the user types (it would make me nervous).
        [/list]Code for the OnCurrent and AfterUpdate events would look like:

        Me.Caption = cboFirstName.Column(1) & ” ” & cboLastName.Column(1)

        where cboFirstName and cboLastName are the names of the combo boxes.

        Note: I have assumed that the first column (index = 0) of the combo boxes is hidden and contains some kind of ID, and that the second column (index =1) is the column that is shown. If your combo boxes have just 1 column, change Column(1) to Column(0) or even omit .Column(…)

    Viewing 1 reply thread
    Reply To: Form Title Bar (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: