Results 1 to 9 of 9
  1. #1
    Steff is offline Novice
    Windows 10 Office 365
    Join Date
    Sep 2023
    Posts
    4

    Problems with Cascading Combo Box



    I have created a database with a cascading combo box in three forms. However, it actually works, but still gives the following error from time to time (translated from Germ. to English):

    You entered the expression After Update as the event property setting. This expression caused an error: Module not found. The expression may not return the name of a macro, user-defined function name, or [event procedure]. An error may have occurred while evaluating a function of a result or a marker.



    I used the following code to update the cascading boxes:
    Private Sub Level_1_AfterUpdate()
    Me.Level_2.Requery
    End Sub
    Private Sub Level_2_AfterUpdate()
    Me.Level_3.Requery
    End Sub
    Private Sub Level_3_AfterUpdate()
    Me.Level_4.Requery
    End Sub
    ...and the same for all the other levels (four levels in total).


    Does anyone know, why I get this issue and how I can solve it? Does it have to do with the updating? I'm quite new to access and usually only work with R or Matlab...




    The file is 500kb to large for an upload, so I'll use this dropbox link, if this is ok? I tried to delete some tables and forms but the .accdb file it didn't get smaller :/
    https://www.dropbox.com/scl/fi/pvz1e...d8fr272fs&dl=0

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Should be able to attach up to 2mb zip file. Use Windows compression and I will be able to extract.

    Be sure to run Compact & Repair first.

    Many will not download from external location.
    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. #3
    Steff is offline Novice
    Windows 10 Office 365
    Join Date
    Sep 2023
    Posts
    4
    Thank you so much! Should be attached now as .zip and I did compress and repair beforehand!
    Attached Files Attached Files

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I tried compact/repair and several other things before importing all your objects into another db, figuring the db was corrupt but no difference. So I copied the rowsource of Level 1 from Formular Hämatologische Tumore then deleted the combo. Then added a new combo, pasted in the row source, reselected the bound field and problem gone. All I can conclude is that you had one corrupt combo which you copied everywhere, either individually or by way of copying forms.

    Spaces and special characters in object names (save for underscore) is not advised.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Why not use better field names than Feld1, Feld2, Feld3, Feld4?

    So you want to save each combobox selection instead of just the record ID of the lookup table. That is duplication of data.

    Since form RecordSource is an unfiltered SQL and not joining tables, could just reference table.

    To echo Micron, strongly advise not to use spaces nor punctuation/special characters in naming convention. I always name controls different from fields or objects, like cbxLevel1. Have dependent comboboxes reference combobox name, not field. Since comboboxes are on same form, should not need fully qualified reference (this is an advantage if form is used as subform). ORDER BY is not needed when using DISTINCT - it's redundant. Should be able to simplify the SQL statements.

    SELECT DISTINCT Feld1 FROM [Häm ICCC-3 und ICD-O];
    SELECT DISTINCT Feld2 FROM [Häm ICCC-3 und ICD-O] WHERE Feld1=[cbxLevel1];
    SELECT DISTINCT Feld3 FROM [Häm ICCC-3 und ICD-O] WHERE Feld2=[cbxLevel2];
    SELECT DISTINCT Feld4 FROM [Häm ICCC-3 und ICD-O] WHERE Feld3=[cbxLevel3];

    However, your db is not liking my changes. At one point I deleted and recreated the first combobox and did not get the error but now it is back. And it can't find the comboboxes with new name nor the old one when I changed back.

    Same assessment as Micron - something is corrupted. Could be just a combobox or the form - rebuild, starting with comboboxes and if needed, the forms.
    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.

  6. #6
    Steff is offline Novice
    Windows 10 Office 365
    Join Date
    Sep 2023
    Posts
    4
    Thanks a lot! This is actually already a full recreated version, since I had the issue before :/ However, I guess I start again and will not use spaces and see if it then works. The error is weird though: If I open another form next to the one that suddenly has an issue and then use the combo boxes of the other form, the error actually disappears and the combo boxes all work again (how?).

    Also tried deleting the first level combo, but yes, error reappeared. I also intentionally didn't copy any forms or boxes in this db (which I did the first time I made this db and had the same error, but the first time the error didn't go away when opening another form...). I will try to rebuild the form tomorrow and see what happens (will then build the whole db again, if necessary).

    Thanks a lot again!!

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    No spaces or punctuation/special characters - that means no hyphens, slashes, octothorps, parens, colons, etc.
    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.

  8. #8
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    ... and use a naming convention to make things easier to follow for everyone, including yourself.
    Naming conventions
    - http://access.mvps.org/access/general/gen0012.htm
    - https://www.access-programmers.co.uk...d.php?t=225837

    What not to use in names
    - http://allenbrowne.com/AppIssueBadWord.html
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    Steff is offline Novice
    Windows 10 Office 365
    Join Date
    Sep 2023
    Posts
    4
    Thanks so much!! Will do!!

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

Similar Threads

  1. Cascading combo
    By byulogia@gmail.com in forum Forms
    Replies: 10
    Last Post: 05-02-2019, 05:07 PM
  2. Cascading Combo Box Problems!
    By aqueousdan in forum Forms
    Replies: 9
    Last Post: 09-14-2016, 02:20 PM
  3. Cascading Combo Box
    By Homegrownandy in forum Access
    Replies: 11
    Last Post: 08-10-2015, 07:50 AM
  4. Replies: 1
    Last Post: 02-27-2014, 03:43 PM
  5. Cascading combo box
    By Plix in forum Access
    Replies: 1
    Last Post: 02-20-2013, 06:54 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