Results 1 to 7 of 7
  1. #1
    Steven19 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2020
    Location
    London
    Posts
    110

    Retaining Information from Related Unbound Combo Boxes

    I presently need advice:

    I presently have a table:
    Has a Primary Key, Then Field 1, Field 2 an Field 3, Field 4.

    I have an unbound form that has 3 combo Boxes (unbound).
    Combo Box 1, contains Field 1, after update Combo box 2 is updated, and shows the filtered list of Field 2


    Combo box two when updated will then after update requery Combo box 3, and once field 3 is updated, the database query displays what is technically in another unbound form the result in Field 4.

    This works wonderfully if I want to just temporarily display the information however I now want to retain this information and use it.

    If I want to create a system where the values from each combo box update are saved, how would I best go about doing that?

    Is there a tutorial or information you know if I could read up on?

    Regards

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,777
    Sounds like you're using what's known as cascading combos.
    If I want to create a system where the values from each combo box update are saved, how would I best go about doing that?
    Easiest is to use bound combos, which creates the situation where their values can be arbitrarily changed. Best might be to keep them unbound but you will have to use code to create the record(s). To do that, you need a trigger - likely a button click event which should first validate as many aspects of the values that you deem necessary. Likely the least would be which combos have values. You might want to disable/enable the button using the after update event of the last combo.

    Are those your real field names?
    Last edited by Micron; 09-09-2021 at 09:39 AM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Steven19 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2020
    Location
    London
    Posts
    110
    Hi Micron

    They are indeed cascading combos

    Not my real field names, I just wanted to explain it in simple terms to be understood.

    Button enabling and disabling are easy enough on the last combo box. And keeping the combo's unbound is a good idea, and the functionality works well at the moment.

    All I need really is a sample or an example of a trigger to work with and I can take it from there and adapt it accordingly.

  4. #4
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,777
    So the trigger would be the button click event I mentioned?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Steven19 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Jun 2020
    Location
    London
    Posts
    110
    When I select from the Combo Box, I suppose the trigger could be the after-update event.

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,777
    Then I guess you'd use that event to build a sql statement and execute it. You could do that all at once within that event, or as you go, using a form level variable. I presume it would be like an append query (INSERT INTO...VALUES...) but if a user can edit existing fields you'll need to code to use append or update.

    All I need really is a sample or an example of a trigger to work with and I can take it from there and adapt it accordingly.
    That means you're good to go now?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,402

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

Similar Threads

  1. Replies: 5
    Last Post: 01-07-2019, 01:51 AM
  2. related combo boxes
    By sara88m in forum Programming
    Replies: 10
    Last Post: 08-30-2017, 04:29 PM
  3. Replies: 6
    Last Post: 02-19-2014, 11:11 AM
  4. Related Combo Boxes
    By Opid in forum Access
    Replies: 4
    Last Post: 06-22-2012, 09:08 AM
  5. Related Combo Boxes
    By Michael T in forum Forms
    Replies: 14
    Last Post: 11-23-2011, 10:39 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