Results 1 to 7 of 7
  1. #1
    Calego is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    10

    Refreshing one object, and leave the rest alone!


    I'm going to try and simplify my problem as best as I can. Hopefully it's clear enough. I have a form that shows a list of items, called "Locations" (just to simplify). Then I have a combo box that has a list of "spare" items to be "installed." The idea is that once the item is installed, it is removed from the combo box list. I have to issue the command "Me.cboInstallPart.Requery." Otherwise, the installed part remains on the list and can be selected again, which I do not want. The problem is that when the "Me.cboInstallPart.Requery" is executed, it also resets the list of locations, so that the current record goes back to "1". It basically seems like every single subform resets. I know this because if I comment out the "Me.cboInstallPart.Requery" command, the locations table stays on the current record, but the combo box still contains the installed part. Just trying to figure out how to do the requery on the combo box without resetting the record position in the locations table. The two tables are not linked together with any child-parent relationship, so I don't know what is going on here. Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Your 'list' is a form in datasheet or continuous view? Requerying a combobox should not affect any other controls or a form. So something else is going on. Requerying or refreshing a form will cause reset to first record.

    What event is the Requery code in?
    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
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  4. #4
    Calego is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    10
    Quote Originally Posted by June7 View Post
    Your 'list' is a form in datasheet or continuous view? Requerying a combobox should not affect any other controls or a form. So something else is going on. Requerying or refreshing a form will cause reset to first record.

    What event is the Requery code in?
    Thanks for your attempt to help. The "locations" table has record source of a query and is in datasheet view. The "spare parts" combo box has the result of a query of the "parts table" where status is "spare." I have a command button below the combo box, so when I click it, all the magic is supposed to happen. So the "On Click" event of that command button is where I have the combo box requery. It is just about the last thing that's done in that event code. The other stuff in there is putting together a long SQL command to UPDATE the "parts table" with the new location (from the "locations" table above mentioned) and the new status of "installed."

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    You mean the "locations" form has RecordSource that is a query? My comments still apply. I need to understand your db structure better and the design of the form and combobox RowSource. I suspect the UPDATE is not really necessary and the combobox RowSource should be different. If you want to provide db for analysis, follow instructions at bottom of my post. If zip is still too large, can upload to fileshare site and post link. I recommend Box.com.
    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.

  6. #6
    Calego is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    10
    Quote Originally Posted by June7 View Post
    You mean the "locations" form has RecordSource that is a query? My comments still apply. I need to understand your db structure better and the design of the form and combobox RowSource. I suspect the UPDATE is not really necessary and the combobox RowSource should be different. If you want to provide db for analysis, follow instructions at bottom of my post. If zip is still too large, can upload to fileshare site and post link. I recommend Box.com.
    I'll have to pass on uploading my db. It has work data in it that might be considered confidential by my employer or client. I'll just have to bang around on it some more to figure it out. It is more of an annoyance, as it doesn't really break the functionality. But thanks so much for the help.

  7. #7
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Calego,

    You could make a test copy of your database, then remove the data you think could be private/confidential, then use names like Porky Pig, Donald Duck..... and cities like BigTown, USA; MiddleVille etc.

    It is not your data that June or others would need to help/experience the issue. It is the structure and processes --the data can be pure mock-up.

    Good luck.

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

Similar Threads

  1. REST Endpoints
    By foo in forum Programming
    Replies: 1
    Last Post: 12-04-2016, 07:53 PM
  2. System DSN (MS Access) to REST API / JSON
    By Hitesh in forum Queries
    Replies: 1
    Last Post: 03-15-2016, 11:37 AM
  3. REST api POST method
    By irade92 in forum Programming
    Replies: 7
    Last Post: 02-03-2015, 03:21 PM
  4. Help with subforms (and the rest)
    By Franco27 in forum Reports
    Replies: 0
    Last Post: 03-14-2011, 09:43 AM
  5. Combox not filling the rest of the form
    By britt britt in forum Forms
    Replies: 2
    Last Post: 10-27-2009, 04:55 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