Results 1 to 10 of 10
  1. #1
    Emmanuel is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    272

    ID to display on access database form


    I have a database with table name : MEMEBERS with fields ID, FIRST_NAME & LAST_NAME.

    I have a form with name ACFORM

    I have a drop down field with name FULL_NAME which picks both first name and last name from MEMEBERS to be displayed together

    My problem is, I want to create a new textbox to display the ID of the name selected.

    For example, if John Smith has an ID of 10, once I select the John Smith from the drop down, the ID number which is 10 should appear in the new textbox automatically.

    Is this possible is access database?
    If so, how can that be done

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    See if this helps:

    http://www.baldyweb.com/Autofill.htm

    That assumes the ID is a field in the combo's row source.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    I have a form with name ACFORM
    Since acForm is an object type constant I would strongly recommend you choose another name.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #4
    Emmanuel is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    272
    Quote Originally Posted by moke123 View Post
    Since acForm is an object type constant I would strongly recommend you choose another name.
    That’s not the real name
    Am only using that to represent the name of the form

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    So the table is not called memebers also? ��
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    Emmanuel is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    272
    Quote Originally Posted by Welshgasman View Post
    So the table is not called memebers also? ��
    All other details are correct
    It was only the form which I didn’t use the actual name

  7. #7
    Emmanuel is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    272
    Quote Originally Posted by pbaldy View Post
    See if this helps:

    http://www.baldyweb.com/Autofill.htm

    That assumes the ID is a field in the combo's row source.
    I didn’t include the ID in the combo. Whenever I try to include the ID in the combo, the names are displayed together without any spacing.
    Example: John Smith displays as JohnSmith

    Will your suggestion still work?

  8. #8
    Emmanuel is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    272
    Quote Originally Posted by pbaldy View Post
    See if this helps:

    http://www.baldyweb.com/Autofill.htm

    That assumes the ID is a field in the combo's row source.
    Also, in the code:
    Me.TextboxName =. Me.ComboName.Column(2)

    Coloumn seems not to work with the auto number ID field

  9. #9
    Emmanuel is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    272
    Quote Originally Posted by Emmanuel View Post
    I didn’t include the ID in the combo. Whenever I try to include the ID in the combo, the names are displayed together without any spacing.
    Example: John Smith displays as JohnSmith

    Will your suggestion still work?
    This has been fixed

  10. #10
    Emmanuel is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    272
    Quote Originally Posted by Emmanuel View Post
    Also, in the code:
    Me.TextboxName =. Me.ComboName.Column(2)

    Coloumn seems not to work with the auto number ID field
    Have been able to find a fix
    Thank u all for your time

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

Similar Threads

  1. Replies: 2
    Last Post: 01-26-2021, 06:44 PM
  2. Replies: 6
    Last Post: 10-30-2018, 04:35 AM
  3. Replies: 2
    Last Post: 06-24-2015, 02:38 PM
  4. Replies: 3
    Last Post: 03-17-2014, 10:23 AM
  5. Replies: 4
    Last Post: 08-21-2013, 07:08 AM

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