Results 1 to 4 of 4
  1. #1
    altemir is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    31

    Bound Text Box Not Requerying


    I have a button control on a subform that opens another input form modally. The problem is that a text box control on the original subform won't requery after the second modal input form is closed. Why???

    Here's my code .... any thoughts??

    DoCmd.OpenForm "frmAttachments", , , "ComplaintLineID = " & CStr(Me.ComplaintLineID), , acDialog
    Me!txtNumAttachments.Requery ' <--- doesn't work; Does nothing to refresh the displayed data

  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,848
    Do you get an error message?
    Is there any control on the modal form that you need in the subform? Just thinking if there was a value needed and the modal form was closed, that would be an issue?????

  3. #3
    altemir is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    31
    No, I don't get an error message. The text box just doesn't display the updated value.

    Regarding your second question, no value needs to be passed from the modal form ("frmAttachments") to the original subform. The modal input form updates a value in the table that underlies the subform using a DoCmd.RunSQL statement. I can see that the table value is correctly being updated because the text box on the subform that is bound to it does have the updated value. IThe subform will correctly display the updated value only if I close the subform and then reopen it. I ran the .Requery method so the user wouldn't have to close the subform to see the correct value.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    The first question for this kind of thing would be is txtNumAttachments spelled correctly? It's not txtNumAttachment, with the ending 's,' for example?

    Another possibility could be that the Control has become corrupted. When we think of corruption, we think of Forms or even entire Databases, but Controls can and do become corrupted, as well. The test for a corrupted Control is the same as the solution, you delete it and the recreate it.

    Just out of curiosity, is doing a Requery of the Subform, itself, out of the question?

    Linq ;0)>

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

Similar Threads

  1. Replies: 2
    Last Post: 06-11-2012, 09:37 AM
  2. Text box bound to combo box
    By Tari in forum Forms
    Replies: 4
    Last Post: 01-11-2012, 02:19 PM
  3. filter report via bound text box
    By JeremyPSU in forum Reports
    Replies: 2
    Last Post: 11-04-2010, 11:03 AM
  4. How to bound a text box
    By bundy75 in forum Forms
    Replies: 10
    Last Post: 07-30-2010, 02:50 PM
  5. I can't enter text in a bound text box
    By Jerry8989 in forum Forms
    Replies: 3
    Last Post: 10-05-2009, 11:52 AM

Tags for this Thread

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