Results 1 to 5 of 5
  1. #1
    Nippy is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2014
    Posts
    2

    Question Cascading ComboBox Issue


    Click image for larger version. 

Name:	CascadingComboError.jpg 
Views:	20 
Size:	40.8 KB 
ID:	15717

    Setting up cascading ComboBoxes for filtering purposes has been somewhat problematic. When selecting a value from cboModel after choosing the Manufacturer in the frmNewEpirb form, I get the above error.

    Has this occurred due to the way my tables are related, the control sources or something else? What have I done wrong?

    Thank you.
    Attached Files Attached Files

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I did not look at your DB but it seems you are trying to save a record (maybe move to another record) before creating another record in another table that is required for referential integrity. Take a look at your relationships window and consider when and where you are saving records or navigating away from a record that was recently created.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Also, your forms are based on recordsets that link tables with INNER JOIN. INNER requires related records in both tables on each side of the join for a record to display.

    What is an Epirb - emergency beacon? It seems purpose of this db is to inventory/track liferafts and beacons. Can a liferaft have multiple beacons?

    A form can enter/edit data for only one table.

    Suggest you simplify form RecordSource and/or change the join type.

    Just bind frmNewEpirb to tblEpirbs.

    The Manufacturer combobox should be UNBOUND because there is no field in tblEpirbs for this value and binding to field from tblEpirbModels attempts to edit record in that table.

    There is no reason to include tblManufacturers in the cboModel RowSource.
    SELECT EpirbModelPK, EpirbModel FROM tblEpirbModels WHERE ManufacturerFK=[cboManufacturer];
    BoundColumn: 1
    ColumnWidths: 0";0.5"
    ColumnCount: 2
    LimitToList: Yes

    The LiferaftName combobox is meaningless. There is no field in tblEpirbs for this value.
    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.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Good catch June, INNER JOIN needs to be reconsidered.

  5. #5
    Nippy is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Feb 2014
    Posts
    2
    That resolved it for me — it all makes sense now.

    I did some reading on SQL joins and now understand why using INNER wasn't leading to the result I expected in my query.

    This has been very helpful. Thanks June!

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

Similar Threads

  1. Editing a Form with a Cascading ComboBox
    By MercyKiller101 in forum Forms
    Replies: 2
    Last Post: 12-12-2013, 03:03 AM
  2. cascading combobox
    By ashu.doc in forum Forms
    Replies: 7
    Last Post: 09-08-2012, 10:39 AM
  3. Replies: 4
    Last Post: 08-06-2012, 07:05 PM
  4. Cascading ComboBox Question
    By Kevo in forum Forms
    Replies: 14
    Last Post: 07-27-2011, 08:48 AM
  5. Autofill Text Box from Cascading Combobox
    By desibabu90 in forum Forms
    Replies: 14
    Last Post: 06-28-2011, 11:31 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