Results 1 to 4 of 4
  1. #1
    ANKUR JAIN is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    2

    Auto populate Primary key in a form based on user selection in 3 dependent combo boxes

    Hello Friends,

    I have a table with 4 fields viz Employee ID (Primary key), FirstName, Surname and Date of Birth. The combination of Firstname, Surname and DOB is UNIQUE.
    My objective is to find out the Employee ID. I have designed a form which has 3 DEPENDENT combo boxes for Firstname, Surname and DOB respectively.


    I expect that after updating the 3 combo boxes a textbox should autofill to reflect the Employee ID. How should I approach this.?



    Regards

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Using an autonumber datatype for your Employee ID is one method.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    So you need a search/filter process? Review http://allenbrowne.com/ser-62.html

    Or use a single combobox that includes EmployeeID and concatenates other fields.

    RowSource: SELECT EmployeeID, Surname & ", " & Firstname & " " & DOB AS Emp FROM Employees ORDER BY Surname, Firstname, DOB;
    ColumnCount: 2
    ColumnWidths: 0";2"
    BoundColumn: 1

    Now the EmployeeID is available for whatever you need it for.




    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.

  4. #4
    ANKUR JAIN is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    2
    Yes, I need a search/filter process. I am aware of the method of using a single combo box but it is required to work with 3 combo boxes. The link shared seems to be addressing my problem but since I am new to MS Access I am finding it difficult to understand.
    Anyways, thank you for your support.

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

Similar Threads

  1. Replies: 1
    Last Post: 06-20-2013, 10:35 AM
  2. Replies: 25
    Last Post: 01-25-2013, 10:26 AM
  3. Replies: 5
    Last Post: 03-07-2012, 12:57 PM
  4. Replies: 2
    Last Post: 12-07-2010, 12:32 PM
  5. Replies: 0
    Last Post: 12-02-2010, 11:59 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