Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jun 2002
    Location
    Michigan City, Indiana, USA
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Form Title Bar (Access 2000)

    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

  2. #2
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Form Title Bar (Access 2000)

    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.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

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

    Re: Form Title Bar (Access 2000)

    You would need code to change the caption of the form in:
    <UL><LI>The OnCurrent event of the form, and
    <LI>The AfterUpdate event of the combo boxes if you want to change the caption after the user has typed/selected a name, or
    <LI>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(...)

Posting Permissions

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