Consulting

Results 1 to 11 of 11

Thread: Save and display data from 3 dependent combo boxes

  1. #1

    Save and display data from 3 dependent combo boxes

    Hello, I'm having trouble understanding how to save data from my 3 combo boxes in form frmVWI (cboDepartment, cboCategories, cboSubcategories). If you look at the image the form uses (tbl_VWI) and I can save the data from cboSubcategories with SubcategoriesID but how do I save the others to my table tbl_VWI? what do I need to add to the tables and relationships to achieve this? I attached my relationship image and my DB broke down for the example.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Looking at the Relationships it appears that you should be able to save the ApproverID as well as the Subcategories.
    But the JobSteps are working the other way, ie the VW11ID is saved the the jobsteps table, which means it should be a Sub form displaying the data, which you have.
    So what do you actually want the combos on your form to do, do you want to have the Department set the categories and the Categories set the sub categories?

  3. #3
    Quote Originally Posted by OBP View Post
    Looking at the Relationships it appears that you should be able to save the ApproverID as well as the Subcategories.
    But the JobSteps are working the other way, ie the VW11ID is saved the the jobsteps table, which means it should be a Sub form displaying the data, which you have.
    So what do you actually want the combos on your form to do, do you want to have the Department set the categories and the Categories set the sub categories?
    On the form frmVWI If I were on lets say record 1 and selected a Department, Category and subcategory and the entire info into the detail section it would save it all and when I go back to record 1 it would display it once again. I think I have to add junction tables to my relationship but not understanding how.

  4. #4
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Is this what you mean?
    Attached Files Attached Files

  5. #5
    Quote Originally Posted by OBP View Post
    Is this what you mean?
    Yes, I didn't think that was correct or normal so I didn't try that. I thought I had to make junction table. One issue though, on the second record it save the data but doesn't display the data? What is wrong with my cbo box row source?

  6. #6
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    That is odd as my version maintains the second record OK.

  7. #7
    Quote Originally Posted by OBP View Post
    That is odd as my version maintains the second record OK.
    The record shows the data only if I go directly to that record. So If I move to record 2 or 3 by first opening and selecting then only #1 displays everything and 2 & 3 only display department and data in detail section.

  8. #8
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    When I closed the database and re-opened it I have the same problem.
    I have added the fields that contain the IDs so that you can see that they have been saved in the table and show up on the form.
    I have added requeries of the combos in the On current event.
    But most improtant seems to be resetting the the Form to NOT Pop-up and NOT modal.
    Attached Files Attached Files

  9. #9
    OBP, I think you attached the old database.

  10. #10
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    Sorry.
    Attached Files Attached Files

  11. #11
    Quote Originally Posted by OBP View Post
    Sorry.
    That requery works in current.... Thanks!

Posting Permissions

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