Results 1 to 7 of 7
  1. #1
    sowieso is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2017
    Posts
    3

    Cascading Combobox changes entry on each form automatically

    Hello together,

    I started working with access recently and have a question regarding cascading comboboxes. I recently completed the cascading combobox and it is working probperly. As follows my tables, I have one table with companies and thec country and in the other I have products which are on the market:

    Table A:
    CompanyName Country
    CompanyB DK

    Table B:
    AutoID Product CompanyName


    1 Pr.A CompanyA
    2 Pr.B CompanyA

    In my form I have a first combobox where you can select the company name and depending on this choice you only the the products offered by this company in the second combobox. All working fine so far.
    If I choose now companyB in a new form, the products from companyA in previous forms are only shown by their AutoId, not by their name anymore. How could I solve this problem that product keeps staying in the other forms.

    Thank you a lot

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    the combo box should have 2 columns,
    ID;PRODUCT

    bound col = 1 (the ID)
    set the COLUMNWIDTHS = 0;2
    this hides the prodID and users only see PRODUCT NAME.

  3. #3
    sowieso is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2017
    Posts
    3
    Thanks for you help, but I already have changed this settings and it doesn't help. Product name is shown as long it fits with the company name last updated in a new form, if it does not match, AutoId is shown instead of product name.
    For example if I am in an already filled out form and change the company name, product name is changing to AutoId because the filled in product are not from that company. Is it possible that the product name stay there no matter if company has changed? Or to cut the dependency from once filled out form to a the combobox of a new form?

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    In the AfterUpdate event of the first combobox, you need to requery the combobox for the product.

    Post your database so we can help further.

  5. #5
    sowieso is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2017
    Posts
    3
    Hello together,
    Thanks for you help. I already did the Afterupdate Event. I uploaded a small sample of how the real data bank looks like. In form Bundle you can choose the company and select the products they offer and which are included in the product bundle, it is saved in table "Bundle".
    What I mean now, if you switch through the different forms you can see that sometimes you see the name of the products in the field product bundle and sometimes only the autoID. Is it possible that you see always the name of the product.

    TestFormular.zip

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The problem is not with the form, it is with the table design. Read up about "normalization" and learn what it is, it will be very helpful for future database designs. Also naming conventions.

    1) company name table (Companies_tbl)
    - must have an autonumber primary key, do not use the name, this changes too often (spelling mistakes, etc)
    - give the primary key a name, such as CompanyID
    - set the field size to the correct size, do not use Access defaults

    2) item list table (Items_tbl)
    - same autonumber primary key, ItemID
    - CompanyID
    - fix field sizes

    3) bundle table (Bundles_tbl)
    - BundleID
    - name of bundle
    - CompanyID

    With the way you have it currently your reporting needs will be a nightmare.
    Last edited by aytee111; 10-16-2017 at 07:21 AM. Reason: changed my mind

  7. #7
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    On rereading this, I need more clarification. You have companies which have products attached to them. When you enter a bundle, why are you even showing the product list? Does the user then select certain products from this list?

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

Similar Threads

  1. Replies: 1
    Last Post: 05-13-2015, 01:14 PM
  2. Editing a Form with a Cascading ComboBox
    By MercyKiller101 in forum Forms
    Replies: 2
    Last Post: 12-12-2013, 03:03 AM
  3. Replies: 6
    Last Post: 06-26-2013, 12:14 PM
  4. Replies: 1
    Last Post: 12-06-2012, 06:11 PM
  5. Replies: 3
    Last Post: 09-19-2012, 11:40 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