Results 1 to 7 of 7
  1. #1
    keviny04 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Apr 2015
    Posts
    128

    Form not showing updated field values for record source with 1-to-1 relationship

    Can anyone tell me if this is a feature or a bug? Please see my attached database:
    Views: 6 Size: 436.0 KB">test1.accdb
    . It is compatible with Access 2007 to 2016. The following phenomenon occurs in Access 2007-2016 as well.

    I have a "Query1" and "Form1" that both have the same data source, which is "Table1" linked to a "Table2" in a left-join 1-to-1 relationship. Now perform the following steps:

    1. Open Query1, and enter a new record by filling in Field1, Field2, and Field3. Leave Field4 and Field5 blank for now. Save the record.

    2. With Query1 still open, open Form1. Go to the record you just created, and change Field3's value and also enter values for Field4 and Field5. Save the record.

    3. Now look at Query1. Field3 has the updated value you just entered in Form1. But why aren't Field4 and Field5 showing updated values?? They are still blank. You have to either press F5 to refresh the query or close and reopen the query to see the updated values.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Why do you have two tables instead of just one?

    Yes, new record does not display until query is refreshed. Not a bug. Expected behavior.

    But why would you have query open anyway?
    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
    keviny04 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Apr 2015
    Posts
    128
    Quote Originally Posted by June7 View Post
    Why do you have two tables instead of just one?

    I am not getting the behavior you describe. All fields show data as I enter it.
    This is just a test database to demonstrate this particular phenomenon. You need to perform the exact steps as I described. Open up Query1, go to a NEW record and fill in Field 1 to 3 with, say, "a", "b", and "c", save record. Leave Query1 open. Open Form1 so you can see Query1 and Form1 next to each other. On Form1, go to that same record, change "a" in Field3 to, say, "d", and enter Field4 and Field5 with, say, "e" and "f". Now on Query1, do you see Field3 to 5 as "d", blank, blank? That is what I see. They should be "d", "e", and "f", but for some reason they aren't.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Yes, I did the same steps and other testing. Revised my first post, apparently after you already read it.

    The behavior you experience is expected.
    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.

  5. #5
    keviny04 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Apr 2015
    Posts
    128
    Quote Originally Posted by June7 View Post
    Why do you have two tables instead of just one?

    Yes, new record does not display until query is refreshed. Not a bug. Expected behavior.

    But why would you have query open anyway?
    In my real-world application, that query is a subform, which has to be opened all the time. When data entry on another form changes the data on that subform, that is when I run into this problem. And I can't refresh the subform because that would move the record pointer away from the current record. I solved this problem by "preemptively" creating a new record for those linked fields, ensuring their updated values will always be shown. Anyway, thanks for confirming your observation.

  6. #6
    Join Date
    Apr 2017
    Posts
    1,673
    Quote Originally Posted by keviny04 View Post
    And I can't refresh the subform because that would move the record pointer away from the current record.
    Before refreshing the subform:
    1. Save Primary Key(s) for current row of subform to variable(s);
    2. Refresh the subform;
    3. Locate the row with Primary Key(s) value(s) equal with saved variable(s) and when found, select the row.

  7. #7
    keviny04 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Apr 2015
    Posts
    128
    Quote Originally Posted by ArviLaanemets View Post
    Before refreshing the subform:
    1. Save Primary Key(s) for current row of subform to variable(s);
    2. Refresh the subform;
    3. Locate the row with Primary Key(s) value(s) equal with saved variable(s) and when found, select the row.
    The user would see the subform jump to the first row and jump back to the row in question, which would not be ideal in terms of UI. If only there were a way to refresh only that row. My takeway from this is avoid using left-join 1-to-1 relationship lest a situation like this arise.

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

Similar Threads

  1. Replies: 9
    Last Post: 07-11-2017, 07:51 AM
  2. Replies: 4
    Last Post: 01-13-2016, 02:04 PM
  3. Replies: 5
    Last Post: 11-12-2013, 12:14 AM
  4. Replies: 2
    Last Post: 06-05-2012, 12:33 PM
  5. Deleting values after a field is updated
    By mwhcrew in forum Forms
    Replies: 3
    Last Post: 08-16-2010, 02:52 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