Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Apr 2002
    Location
    United Kingdom
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatic update of Contact Name field in a form (Access 97)

    I have a simple form that contains a customer number, name and address - nothing too complex ;-)

    What I need is for the 'contact' field to be automatically updated with a trimmed version of the 'title', 'christian' and 'surname' fields once they have been entered on the form so that after the user has tabbed out of the surname field and into the contact field, the trimmed contact name is already done for you and is highlighted just in case the user may want to edit it still.

    I can manually do this with a query like: trim([title]&" "&[christian]+" "&[surname]) but I can't seem to get it to run properly from the form without all sorts of annoying little glitches happening - sorry but I'm kinda new to programming access databases.

    Any help much appreciated - VBA code welcome if it's easy enough - thanx in advance.

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Automatic update of Contact Name field in a form (Access 97)

    Place the following in the AfterUpdate event of the Surname field on your form.

    Me!Contact = trim([title]&" "&[christian]+" "&[surname])

    HTH
    Pat

  3. #3
    New Lounger
    Join Date
    Apr 2002
    Location
    United Kingdom
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatic update of Contact Name field in a form (Access 97)

    Excellent! Thanks for that, worked a treat!!!

Posting Permissions

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