Results 1 to 2 of 2
  1. #1
    Sumo is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2013
    Posts
    1

    Updating one box from another

    Really new to Access so appreciate any help here.


    I am trying to update one text box on a form based on the input into another. In the first text box I input manually from a combo box my colleagues Corp ID, in the next I want this to automatically pull through the persons name. I have a query written with the name in the column next to the Corp ID but I can't figure out how to pull it through. Tried dlookups on event change but can't get the coding right.
    Any help?

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    If CorpID is defined as Text

    Code:
    Me.PersonName = DLookup("PersonName", "TableOrQueryName", "CorpID = '" & Me.CorpID & "'")

    If CorpID is defined as a Number

    Code:
    Me.PersonName = DLookup("PersonName", "TableOrQueryName", "CorpID = " & Me.CorpID)

    Linq ;0)>

    Place it in the AfterUpdate event of the CorpID Combobox and replace all names with your actual names.

    Linq ;0)>

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Updating
    By stefan200593 in forum Access
    Replies: 1
    Last Post: 03-31-2013, 09:37 PM
  2. updating data
    By Sarge, USMC in forum Access
    Replies: 1
    Last Post: 01-05-2013, 09:11 PM
  3. Updating Tables
    By Davidyam in forum Access
    Replies: 4
    Last Post: 03-01-2012, 08:36 PM
  4. updating a record
    By markjkubicki in forum Programming
    Replies: 18
    Last Post: 09-19-2010, 08:20 AM
  5. FE & BE Updating
    By mastromb in forum Access
    Replies: 5
    Last Post: 02-12-2010, 11:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums