Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Join Date
    Jun 2004
    Posts
    46

    Unhappy Unanswered: Combo Box Fetures

    hi, i have some data that i want to look up based on a combo box, but some how im not able to do this is there some code that i have to input or do i just put in the table source???? these are on the same table "Employees", wich brings me to my other question.... based on this records i want another table called "Projects" be displayed in a spred sheet based on the proyects that he has or where assigned to him


    this is an examble

    -------------
    Employee |V| <---- Based on this combo box diplay everything
    -------------
    --------------
    Employee Id | |
    --------------
    Name | |
    --------------
    phone | |
    --------------
    Supevisor Name | |
    --------------
    Supervisor Email | |
    --------------

    spred sheet starts
    --------------------------------------------------------------------------
    |Project Number| Project Name|
    --------------------------------------------------------------------------

    Any takers?

  2. #2
    Join Date
    Jun 2004
    Posts
    55
    Okay so you have table that has only the employee names? then another table with: Employee Id , Name, phone, Supervisor Name, Supervisor Email. And yet another table with: Project Number, Project Name.


    If I'm incorrect, just give us a list of the tables you're using and the their fields.

  3. #3
    Join Date
    Jun 2004
    Posts
    46
    thnx for replying dwil2g1... the tables are as follow

    Employee
    Employee_ID
    Name
    Phone
    Supervisor_Name
    Supervisor_Email

    the spred sheet part that i want is in another table

    Project
    Project_ID
    Project_Name
    Project_Description
    Project_Added <---- this field i want it to not show (only for supervisors)

  4. #4
    Join Date
    Jun 2004
    Posts
    55
    Okay you're going to needs a field that is the same in both tables. I just having Employee ID in both tables. Those two fields in the table need to be linked. I'll walk you through the rest once you get that up.

  5. #5
    Join Date
    Jun 2004
    Posts
    46
    ups sorry... i forgot one table the one that is most important

    Employee
    Employee_ID :M
    Name
    Phone
    Supervisor_Name
    Supervisor_Email

    the spred sheet part that i want is in another table

    Project
    Project_ID :M
    Project_Name
    Project_Description
    Project_Added <---- this field i want it to not show (only for supervisors)

    EmployeeProjects
    Employee_ID
    Project_ID
    Assing_By <--- This is a query field that gets info from employees Supevisor_ID
    or Supervisor_Email

  6. #6
    Join Date
    Jun 2004
    Posts
    55
    Ssssoooo...the last one is a query that you have or a table?

  7. #7
    Join Date
    Jun 2004
    Posts
    46
    its a table for making the M:M part i don't know if that's relevant.... but thats the way that i have it setup if i put Employee_ID on the Project Table, and Project_ID in the Employees Table wont i just be making redundant data???

  8. #8
    Join Date
    Jun 2004
    Posts
    55
    No, basically you're just adding in an extra step with that third table, but it doesn't really matter anyway that table will do. So what you need to do is make a query with the all three table in it.

    Link Employee ID (from the Employees table) to Employee ID (in the Employee Projects tables) and Link Project ID (in the Employee projects) to Project ID (in the Project table).

    Then you need to add these fields to the query

    (from Project table)
    Project_ID :M
    Project_Name
    Project_Description

    (from Employee table)
    Name (make uncheck the show option and make the criteria for this field: [Forms]![Nameofyourformwiththecombobox]![Nameofcombobox])

  9. #9
    Join Date
    Jun 2004
    Posts
    55
    and since I have to go soon I'll tell you how to finish this off.

    In you're for form design view goto the events in the properties for the combobox. Use the on AfterUpdate event, with code builder and put in:

    DoCmd.OpenQuery "NameofQuery"

    That should do it for you Hope that's what you want.

  10. #10
    Join Date
    Jun 2004
    Posts
    46

    lost in translation

    Quote Originally Posted by (from Employee table) Name (make uncheck the show option and make the criteria for this field: [Forms
    ![Nameofyourformwiththecombobox]![Nameofcombobox])

    ok thanx for tip but what you stated before i infact had it allready the relationships i don't know if that whats you where refering to.... but you lost me in the quote, i have to do this in the query builder or in the form???? where is the ''show option" and where do i put the criteria??? in the form??

    sorry to be such a pain but u lost me there!

  11. #11
    Join Date
    Jun 2004
    Posts
    46
    im such a putz.... sorry... "QUERY" now we are in the same page.... but no luck id what u told me and it said no value given, also if i uncheck it it wont let me select if i go to the wizard, i do it manually it gives me that error no given value....

  12. #12
    Join Date
    Jun 2004
    Posts
    55
    Yeah I know...you need the form to be open to use the query. That's why I had the coding in the form open the query.

  13. #13
    Join Date
    Jun 2004
    Posts
    46
    thnx for all your help... and sorry to be pain but you lost me whe you said...

    Quote Originally Posted by dwil2g1
    you need the form to be open to use the query. That's.
    you mean running??

    because when i do that it runs but it doesn't display anything
    but when i go to use the wizard and look the query it doesn't even show the Employee_ID because of the un check.... if i leave it checked and put the criteria that you told me it also says the same no value given....

  14. #14
    Join Date
    Jun 2004
    Posts
    55
    Hrm...this should work fine....now lemme think. What are you using as your rowsource for the combo box? If you're using the Employee ID field from the query it will no show, but if you're getting the rowsource from a different table or query than it should work fine. Otherwise I'd have to see the database.

  15. #15
    Join Date
    Jun 2004
    Posts
    46
    mmmmm well im using the query that u suggested but no luck... where do i send it to? so you can see?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •