Results 1 to 4 of 4
  1. #1
    chrisalang is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2016
    Posts
    2

    Relationship field error

    Hello,
    I am new to Access 2016 so please be gentle.


    I am setting up various databases for my business. In one database for staff I currently have 2 tables. The first is their details and the second hours worked and overtime etc. I have set up a relationship between the two using the primary key in the details table and then a field called employeeid in the hours database. I have then set up a combo box with a drop down menu to enable me to drop down the list of employees and select them by name. This is all working but when i select the employee the error that this is not the correct data type pops up. Both data types are set to numerical and although I know the name is not numerical when I have looked at other databases with the same set up they appear to be identical to mine. Please can someone advise what setting I need to change. many thanks. Chris

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Your combo box has to include the Employee_id in an invisible column (column width = 0, and usually the first one), and that should be the Bound Column. So, while you see the Employee name, you are storing the Employee ID in the table field you have set as the Control Source for the combo box.

  3. #3
    chrisalang is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2016
    Posts
    2
    Quote Originally Posted by John_G View Post
    Your combo box has to include the Employee_id in an invisible column (column width = 0, and usually the first one), and that should be the Bound Column. So, while you see the Employee name, you are storing the Employee ID in the table field you have set as the Control Source for the combo box.
    Thank you - that has solved the error. I can now display the first name and surname in the drop down menu but when I select it only the first name is showing.

  4. #4
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    After selection, a combo box will show only the fist visible column (width > 0). If you want to see both first and last names after you make the selection, you will have to concatenate them into one field in the row source (query) for the combo box.

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

Similar Threads

  1. Replies: 7
    Last Post: 09-09-2015, 10:34 AM
  2. Replies: 0
    Last Post: 03-06-2012, 11:55 PM
  3. Relationship Error
    By jay055 in forum Access
    Replies: 7
    Last Post: 02-06-2012, 01:19 PM
  4. Relationship error
    By usman666 in forum Database Design
    Replies: 4
    Last Post: 10-26-2011, 05:34 PM
  5. Replies: 0
    Last Post: 03-15-2010, 02:38 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