Results 1 to 4 of 4
  1. #1
    cchampagne17 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    7

    Question Settling Synconized combo boxes to keep their values on new records

    Hello,



    I've found myself in quite the perdicament.. I have 2 combo boxes in a form. One combo box has a list of categories, while the second bombo box is synconized so that it pulls the category selected's coresponding subcategories from it. The rest of the boxes in my form are not synced and I've programmed them to keep their value if someone makes a new record.

    I used the same code (the one that tells the combo boxes to retain values) that I used for the other combo boxes on the synconized combo boxes. However only the category box stays the same, and the subcategory is empty and I have to re-select the category inorder to get the list of corresponding subcategories. Is there any way that I can get box boxes to retain their values in new records until someone has to manually change it? Because right now I'm having a lot of problems figuring it out...

    This is the code I used for a box to retain its previous value in a new record...

    Private Sub Combo76_AfterUpdate()
    Me.Combo76.DefaultValue = """" & Me.Combo76.Value & """"
    End Sub

    This is the code that sorts the subcategory box to select the subcategories that correspond with the selected category...

    Private Sub Combo70_AfterUpdate()
    Me.Combo72 = Null
    Me.Combo72.Requery
    Me.Combo72 = Me.Combo72.ItemData(0)
    End Sub

    I've tried removing the "null" from the code but that doesn't do anything...

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    Are these comboboxes in a Continuous or Datasheet view form? Is the second combobox a multi-column with lookup alias? Dependent comboboxes with lookup don't act nice in those forms. This is a common topic and has been discussed in this forum.
    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
    cchampagne17 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    7
    Quote Originally Posted by June7 View Post
    Are these comboboxes in a Continuous or Datasheet view form? Is the second combobox a multi-column with lookup alias? Dependent comboboxes with lookup don't act nice in those forms. This is a common topic and has been discussed in this forum.
    The combo boxes are in continuous view form. Sorry for the confusion. Combo70 is the combo box for the broader categories while Combo72 is the second combo box that looks up the corresponding subcategories for the general category selected in Combo 70.

  4. #4
    cchampagne17 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    7
    Quote Originally Posted by June7 View Post
    Are these comboboxes in a Continuous or Datasheet view form? Is the second combobox a multi-column with lookup alias? Dependent comboboxes with lookup don't act nice in those forms. This is a common topic and has been discussed in this forum.
    I actually figured out how to do it. It turns out that I had an extra requery code written in that cleared the subcategory box each time a new record was created even though I was using the code that makes the combo box retaining the values... Clearing that extra requery code made it so that the subcategory combo box stayed the same for each new record.

    Thank you for your help!!

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

Similar Threads

  1. Incorrect Values Populating My Combo Boxes
    By charlyzaingel in forum Forms
    Replies: 19
    Last Post: 06-23-2011, 10:17 AM
  2. Restricting values in combo boxes
    By Remster in forum Access
    Replies: 4
    Last Post: 09-08-2010, 12:24 PM
  3. Replies: 1
    Last Post: 03-27-2010, 06:13 AM
  4. Replies: 2
    Last Post: 08-24-2009, 10:36 AM
  5. Replies: 10
    Last Post: 08-01-2009, 06:48 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