Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28
  1. #16
    stevekroll is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    16

    I now understand that only the ID from the Employee Staff table is stored in the Employee ID field of the Allocations Table. Where exactly is the combobox RowSource located? Which table field are you referring to where the full name will be displayed?

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You can set field in table to behave like a combobox - a control with a dropdown list. With Allocations table in Design view, select the EmployeeID field and click on the Lookup tab at bottom of the designer. Select combobox and set the RowSource property. The EmployeeID field will then display the related full name instead of the actual content of ID.

    However, the recommendation is to NOT do this in table. Build a form bound to table and create combobox control on form.
    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. #18
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  4. #19
    stevekroll is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    16
    I think all of you have encouraged/warned me to build a form and create a combobox control on the form. I will do this instead of doing this in a table. Can you tell me the reason why doing it directly in a table is not a good idea? What problems does it present to the database?

    I really appreciate this forum. I want to thank everyone for responding to my question and trying to point me in the right direction.

  5. #20
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  6. #21
    stevekroll is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    16
    I see that I could accomplish this through a query. I don't need the full name in the Allocation Table. Meaning I would just define a relationship between the ID field of the Employee Staff table and the Employee ID field of the Allocation table. In Table Design View, when I initially define Employee ID field, what do I type in? Do I do a Lookup just selecting the ID field from the Employee Staff Table? When I create the input form for Allocation, what would be entered in the Employee ID field?

  7. #22
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    You will need a unique identifier to create joins. This would be the primary key. It will join to the foreign key field in another table. In most cases, an autonumber data type is appropriate for the PK's and the FK's would then be, Long Integer.

    The Employee ID field may be important to the user. The user may need to see the Employee ID field and understand its value because it may be relevant to daily operations. If this is the case, you may consider using a second field as the PK, maybe naming it EmpPK, and use the Autonumber data type. Regardless, you should have an autonumber as PK and long integer as FK. You should create the joins using these fields.

    With the appropriate PK/FK structure, most all of your concerns about First Name/Last Name will sort themselves out.

  8. #23
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    As already stated, don't build lookup in table. Just create the fields. Build combobox on form. Set the same properties that would be set in table lookup.

    Here is how to set up a multi-column combobox http://www.datapigtechnologies.com/f...combobox3.html. Do this on form bound to Allocation table.

    The combobox RowSource could be:

    SELECT EmpID, LastName & ", " & FirstName AS EmpName FROM Employees;
    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.

  9. #24
    stevekroll is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    16
    The ID field of the Employee Staff table will be the primary key and will be joined to the Employee ID(foreign Key). ID of Employee Staff is an Autonumber data type and Employee ID will be long integer. The joins will be on these two fields since it will be defined as a relationship.

  10. #25
    stevekroll is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    16
    Ok. I will just create the field Employee ID in the Allocation Table as a number/long integer? Just define it like that? Then go to Forms and create the combo box on form. Do I have to create the combobox in Design View or is Form View okay? Where do I access the combobox?

  11. #26
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Design view, in the toolbox.

  12. #27
    stevekroll is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    16
    I wanted to thank everyone for helping me. I was able to successfully implement the combobox in a form. Then I used the form to input sample records to populate the table and then created a query. I also found the pivot table very helpful for what I am doing.

    I have found one very strange thing though. Since I am dealing in two decimal entries, I have formatted it as single(field size), fixed and two decimal places. I am able to enter it fine in the input form, but in the certain fields in the crosstab query it displays the value such as .24 from the form as .239990000007896(15 decimal places) instead of .24. I noticed in the pivot table when I hold the cursor over the number correctly displayed as .24 it highlights as.239990000007896 as if this is what is being stored. Totals add up okay in queries and reports based off the queries, but the query details section all values were 15 digits except .25. Does anyone know what is going on here? How can I fix this? I have made sure that every property for each cell is fixed and two decimal places.

  13. #28
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I don't know what's in your cross tab, but this sort of thing is often resolved with

    Round(YourFieldName,2) but read this info before accepting this as a solution

    another option may be to format yourField as "Currency"

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 07-25-2013, 11:34 PM
  2. Replies: 3
    Last Post: 06-28-2013, 01:59 PM
  3. No lookup fields at table level then what?
    By justgeig in forum Database Design
    Replies: 3
    Last Post: 06-05-2012, 11:29 AM
  4. Importing into Table with Lookup Fields
    By Fstrategic in forum Import/Export Data
    Replies: 7
    Last Post: 02-16-2012, 05:26 AM
  5. Lookup table combining 2 fields
    By jhoff in forum Access
    Replies: 1
    Last Post: 07-27-2011, 09:31 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