Results 1 to 4 of 4
  1. #1
    mejia.j88 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228

    Question cmd.requery(specific query) requeries all queries on my form! please help!

    Hello programmers,

    I have a form that uses 1 cbo box called cboWO based on a main query to populate text boxes and a list box. Call it Qry_WO.

    i have another query filtered by the text boxes mentioned above. Call it Qry_Boat.
    qry boat populates a cbo box called cboBoat, operators will choose the appropriate option.


    in the event that an operator chooses the wrong option in cboWO, then chooses the correct one, I want qry_boat to requery to yield hte correct options for cboBoat.



    in my vba code, when i type

    docmd.requery (qryBoat) it refreshes the other queries on the form.

    how can i avoid this from happening. it should only requery that specific query.

    thank you,
    Jorge


    i can post the code if needed. i can also post the db using dropbox or a similar option.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try

    Me.cboBoat.Requery
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    mejia.j88 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Location
    california
    Posts
    228
    Pbaldy, this works great.
    I tried it yesterday before I left work, it worked the first time but i didn't have time to test it.

    Do you know why docmd.requery (queryname) requeries everything?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I would speculate that it's because you didn't properly specify the control, which would look like:

    docmd.requery "qryBoat"

    But I always use the syntax I posted, so I'm not sure.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 12-31-2012, 06:25 PM
  2. avoiding long requeries
    By dennisem in forum Queries
    Replies: 2
    Last Post: 11-04-2012, 05:35 PM
  3. Replies: 1
    Last Post: 06-15-2012, 05:51 PM
  4. Replies: 11
    Last Post: 07-08-2011, 02:12 PM
  5. Combo box requeries a subform
    By techaddiction7 in forum Database Design
    Replies: 0
    Last Post: 06-07-2010, 11:12 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