Results 1 to 3 of 3
  1. #1
    ycrozier is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    1

    Combo box requery on main form returns subform to first record

    I have a Customer form with a subform showing the customer locations which is the main form for the application. On this form, I have an unbound combo box with a list of currently open orders, which pops open an order form when an order is selected from the list.



    I put a requery command on the OnEnter event of the combo box to ensure that any new, shipped, and cancelled orders by other users are refreshed on and off the list each time it is used. (Forms!frmMain!SearchOrder.Requery)

    As soon as the combo box requeries, the Customer location subform returns to the first record. I have even written code to record the location that the form is on before the requery, and then navigate back to that location on the subform after the requery... a silly workaround I know. It works when I step through it in debug mode, but as soon as I remove the breakpoint and just let it run, it doesn't work anymore.

    Has anyone ever come across this before and figured out how to fix it?
    I am tearing my hair out!
    Thanks in advance
    Yvonne

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    well the point on why it doesn't work when you remove the breakpoint is because the 'natural' order/sequence of events is different than your debug mode....am pretty sure about this - though less sure as to where you should move that line of code as I'm not entirely clear on your config..... i.e. the subform is firing after your code and undoes that value.....(or could be the form as I'm not sure how to interpret your post)....

    hope this gets you on the right path.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    8,802
    Would you care to post the dB? (Change any sensitive data first.) I tried to follow what yo wrote, but got confused.
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

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

Similar Threads

  1. Requery Main Form, Keep Focus on Subform
    By burrina in forum Forms
    Replies: 8
    Last Post: 11-21-2012, 03:50 AM
  2. Replies: 1
    Last Post: 11-18-2012, 06:24 PM
  3. Requery subform after update of main form
    By gemadan96 in forum Forms
    Replies: 3
    Last Post: 10-17-2012, 02:33 PM
  4. Replies: 3
    Last Post: 04-17-2012, 10:28 AM
  5. Replies: 3
    Last Post: 10-10-2011, 06:33 PM

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 - Senior Forums