Results 1 to 4 of 4
  1. #1
    jmitchelldueck is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    51

    Autofilling a field based on an entry in a separate field

    Hi,

    I am creating a database tracking physicians and their contracts. I currently have two tables: PhysicianT and ContractsT, with corresponding forms to enter information in them.

    I have an issue with the Contracts form; I want to be able to select a physician from a dropdown list (looked up from PhysicianT) and have Access autofill their Physician ID #.

    PhysiciansT looks like this:

    physicianID (AutoNum) name (Calculated)
    1 Barker, Bob
    2 Burgundy, Ron
    3 Stark, Tony

    Upon selecting Barker, Bob from my dropdown list, I want "1" to appear in the Physician ID # field in my Contracts form.

    I am looking for a way to do this without VBA code please!



    Thank you for your help.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    No code needed. Use a multi-column combobox. Review: http://datapigtechnologies.com/flash...combobox3.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jmitchelldueck is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2015
    Posts
    51
    Quote Originally Posted by June7 View Post
    No code needed. Use a multi-column combobox. Review: http://datapigtechnologies.com/flash...combobox3.html
    How do I get the Physician ID # from my form back in to my table? I'm using the combo box for the Physician Name and a text box with control source = [combo box] as per the video you linked me to. Is the control source line in the property sheet the only way to link tables and forms together?

    Thanks.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The combobox should be bound to the field where you want to save the PhysicianID. Yes, the ControlSource property connects to field in the form's RecordSource. This will commit data to table.

    Should not need the textbox. A ControlSource with = sign is a calculated value. Calculated values are not automatically saved to record. The textbox is only if you want to display other info from the combobox item.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Message Box based on field entry
    By FormerJarHead in forum Forms
    Replies: 9
    Last Post: 11-04-2014, 11:54 AM
  2. Replies: 2
    Last Post: 12-04-2013, 05:38 PM
  3. ID field autofilling text field on another form
    By ledmark in forum Programming
    Replies: 0
    Last Post: 03-24-2011, 10:12 PM
  4. Help autofilling a field
    By fullause in forum Access
    Replies: 1
    Last Post: 02-18-2011, 05:54 AM
  5. Replies: 10
    Last Post: 04-21-2010, 01:16 PM

Tags for this Thread

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