Results 1 to 13 of 13
  1. #1
    moona is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2013
    Location
    Mississauga, Ontario, Canada
    Posts
    14

    combo box - requery not firing

    what could be causing the me.combox_name.requery to not fire?



    I have created two combo boxes - everything works the first time I open the form.
    The first combo box (master) drops down with the list of records
    go to the second combo box (child) and I see the "filtered" records based on the value selected in the first combo box.
    I select the record I want.

    Go back to the first cmb and select a different value for master
    back to the child cmb and I see the same old values


    I have a me.cmbchild.requery afterupdate event for the cmbmaster.

    What's missing?
    Attached Files Attached Files
    Last edited by moona; 04-20-2013 at 01:43 PM. Reason: identify the form I am using...

  2. #2
    moona is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2013
    Location
    Mississauga, Ontario, Canada
    Posts
    14
    The form I am using in this example is frmMain

    Thanks.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Make sure you have spelt the name of cmbChild correctly .
    Check that you have [Event Procedure] as the setting of the After Update event of cmbMaster.
    Can you post a copy of the db in Access 2003 mdb format.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    moona is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2013
    Location
    Mississauga, Ontario, Canada
    Posts
    14
    Thanks Bob...checked out everything as per your suggestions. Posted a 2007 version of the db - zipped. The form you need is frmMain.
    I have to get it working on 2007.

    appreciate your help.

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by moona View Post
    Thanks Bob...checked out everything as per your suggestions. Posted a 2007 version of the db - zipped. The form you need is frmMain.
    I have to get it working on 2007.

    appreciate your help.
    I know that you posted a copy of the db in your first post, but I use A2003 which can not open files created in a later version. That is why I asked if you could post a version in A2003 mdb version.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Put your REFRESH command in the ON EXIT event instead of the AFTER UPDATE event

  7. #7
    moona is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2013
    Location
    Mississauga, Ontario, Canada
    Posts
    14
    Hi rpeare, tried that...no difference.

  8. #8
    moona is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2013
    Location
    Mississauga, Ontario, Canada
    Posts
    14
    sorry Bob, wasn't sure if you had posted your response pre-post my upload of the zip file.
    Ok, I am attaching it here after "save as"....
    Attached Files Attached Files

  9. #9
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I downloaded your sample database, cut what you had from the afterupdate event, pasted it into the ON EXIT event and it worked properly.

    this is the code exactly
    Code:
    Private Sub cmbmaster_AfterUpdate()
    End Sub
    
    Private Sub cmbmaster_Exit(Cancel As Integer)
    Me.cmbchild.Requery
    End Sub
    and it correctly requeries the second combo box

  10. #10
    moona is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2013
    Location
    Mississauga, Ontario, Canada
    Posts
    14
    Nope...no luck at my end...that's the only code I have on the form and it does not work for me.

    Code:
    Option Compare Database
    Option Explicit
    
    
    
    
    Private Sub 
    cmbmaster_Exit(Cancel As Integer)
    Me.cmbchild.Requery
    End Sub
    ...as suggested in one of the threads on this site...looking for updates for 2007. I thought I had applied all of them. But just in case, I missed something.

    as expected...no updates for Ms-Access 2007.

    Something is missing/corrupted...

    I'll try creating a brand new db, form, tables and see where that takes me.
    Will keep you posted.
    Last edited by moona; 04-20-2013 at 03:45 PM. Reason: adding more info..2

  11. #11
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by moona View Post

    ...that's the only code I have on the form and it does not work for me...
    To allow Code to run in 2007/2010 you need to declare the Folder as 'Trusted.'

    To trust your folder, click:

    1. Office Button (top left)
    2. Access Options (bottom of dialog)
    3. Trust Center (left)
    4. Trust Center Settings (button) on far right
    5. Trusted Locations (left)
    6. Add new location (button)
    7. Enter Folder Name
    8. Click on Okay

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  12. #12
    moona is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2013
    Location
    Mississauga, Ontario, Canada
    Posts
    14
    I don't believe this....but that's what did it....

    In order of things...

    I ended creating a brand new from scratch, db, tables, forms etc...and it was working exactly like I wanted it.
    I then saved it and closed A2007.
    Came back and re-opened it and it was broken.
    Scratched my head...

    Launched A2003...
    created a new db, form, tables etc...
    worked fine.
    closed everything.
    launched A2003
    everthing still working...

    Refresh my browser...and see your response.

    try it and A2007 works....Bless you.

    I must have searched and googled and no where did I see this solution posted.

    Thanks a lot.

  13. #13
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Well, you're not apt to forget it now, are you?

    Glad we could help!

    Good luck with your project!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Requery with cascading combo boxes
    By TanyaH in forum Forms
    Replies: 8
    Last Post: 04-21-2013, 07:12 AM
  2. Requery does not update combo box
    By pbouk in forum Forms
    Replies: 1
    Last Post: 03-25-2013, 03:01 PM
  3. Help with Combo Boxes/requery....etc
    By noaccessguru in forum Forms
    Replies: 9
    Last Post: 06-06-2011, 05:50 PM
  4. Combo Box Requery Issue
    By Grizz2 in forum Forms
    Replies: 4
    Last Post: 06-02-2011, 08:14 PM
  5. Replies: 1
    Last Post: 03-13-2011, 02:29 PM

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