Results 1 to 6 of 6
  1. #1
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Sep 2013
    Posts
    287

    text box linked to field table not requerying/refreshing

    Hey guys,



    I have a 2 text boxes on a form that are directly linked 2 date fields in an underlying table. After a button is pressed, a subroutine fires. This sub changes the data in the underlying table. The last 2 lines in that subroutine are a requery of the 2 text boxes that I am having issues with. When the whole thing is done, the 2 text boxes say "#Deleted." I have even created a button just to requery those 2 text boxes. That doesn't work either. Changing to design view, then back to form view doesn't refresh the text boxes either. I have confirmed that the data is in the table. Close the form and reopening does refresh them.

    Ideas on why the requery isn't working?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I've just mocked this up. Form based on a table, 2 date fields in text boxes.
    A button on the form that does a save record in on click event.

    I change the record manually on the form, then click the button.
    Record is saved with updated values. No errors.
    No requery needed.

    Perhaps your subroutine is doing more and it is something there that's causing the issue???

    Click event (via wizard -)
    Code:
    Private Sub Command9_Click()
    On Error GoTo Err_Command9_Click
    
    
        DoCmd.RunCommand acCmdSaveRecord
    
    Exit_Command9_Click:
        Exit Sub
    
    Err_Command9_Click:
        MsgBox Err.Description
        Resume Exit_Command9_Click
        
    End Sub
    Attached Thumbnails Attached Thumbnails forsnipe.jpg  

  3. #3
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Sep 2013
    Posts
    287
    Ah you are a bit backwards in what is going on with mine.

    The 2 text boxes pull the "Date From" and "Date To" of the table. The show the user what range of data is currently stored. Every record in the table has the date from and date to.
    Click image for larger version. 

Name:	Screen Shot 2015-02-10 at 3.23.43 PM.png 
Views:	8 
Size:	47.9 KB 
ID:	19644

    The user inputs 2 dates into 2 date pickers (different than the 2 text boxes that are giving me issues). They click the button that fires the sub. The sub clears the table, runs a bunch of queries and calculations, then appends the new data into the table, then (theoretically) requeries the 2 text boxes so the user can see which date range is currently stored.
    Click image for larger version. 

Name:	Screen Shot 2015-02-10 at 3.23.55 PM.png 
Views:	8 
Size:	11.7 KB 
ID:	19645

    I have deleted and recreated those text boxes thinking they may have been corrupt. I have tried 2 different methods of requerying: DoCmd.Requery "textbox" and me.textbox.requery. Nothing seems to work.

    Everything else works great. Any queries and reports that go off the stored data have no issues. This is just baffling me....

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Have you tried a requery of the actual form instead of the text boxes.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2003
    Join Date
    Sep 2013
    Posts
    287
    Bob Fitz for the win!

    Thanks for the help you two!

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Bob and I were glad to help. (Good one Bob!)

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

Similar Threads

  1. linked in table need refreshing in backend?
    By vientito in forum Programming
    Replies: 3
    Last Post: 10-16-2014, 08:33 AM
  2. Replies: 0
    Last Post: 09-03-2014, 02:37 PM
  3. Refreshing the form vs. requerying
    By Access_Novice in forum Forms
    Replies: 9
    Last Post: 01-01-2014, 07:24 PM
  4. Linked tables and refreshing
    By offie in forum Import/Export Data
    Replies: 1
    Last Post: 06-20-2013, 01:42 PM
  5. Bound Text Box Not Requerying
    By altemir in forum Forms
    Replies: 3
    Last Post: 02-19-2013, 09:06 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