Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283

    Subform Requery

    Hello,



    I have a couple subforms on a form called Errors. And I have a command button on a form named Validate. The subform I want to requery is called Error_Sheet_CB_Subform. I write the code Me.Error_Sheet_CB_Subform.Requery and an error comes up and displays Compile error: Method or data memeber not found. I don't understand why it is doing this.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I've seen that work, but you can try

    Me.Error_Sheet_CB_Subform.Form.Requery

    If you still get an error, you want the name of the subform control there, not the subform itself if they're different.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    That doesn't work. But even when I type in Me. then start typing in the name of the subform it doesn't appear. the database doesn't have any of the subforms recognized

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    With the form in design view, click elsewhere on the form and then once on the subform. Looking at the properties, you should be looking at the subform control. You want the name of the control. If you're still stuck, can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    I don't know where you are seeing subform control at. I see Source Object and the Name. I cant send you the DB because there's health info on here. I just don't know why it's doing this. I had no problems with the other databases I built doing this

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What are the source object and name properties?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    Whoops sorry i noticed I calld said the wrong name of the subform..it's called Error_Sheet_CVS_Subform. in the Name field it's called Error_Sheet_CVS subform and in the Source Object field it's called Error_Sheet_CVS_Subform. I tried changing the name to Error_Sheet_CVS_Subform and it still didn't work.

  8. #8
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    When I use it on the same form as the subforms are on it works..But it doesn't work when Im on a different form. Is there any way to make it work from a different form?

  9. #9
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    Nevermind guys I found it out the code when using from seperate forms

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Glad you got it sorted.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    Now it doesn't work..It worked yesterday and now it doesn't today..For example, the forms I'm using are called Validate and Errors. The subform Error_Sheet_CVS_subform in on the Errors form. I'm requerying it from the Validate form..so the code I used is Forms![Errors]![Error_Sheet_CVS_subform].Form.Requery I even called it from the Errors form and it's named correctly. I have no idea why it isnt working..I made another copy of this database and then it stopped working? idk why

  12. #12
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    Now I figured out the form has to be open for it requery..does anyone know of a way where it doesn't have to do that?

  13. #13
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Not sure either. Is the data from the second form saved at the point you requery?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sorry, was typing while you posted. Why would you requery a closed form? It will requery when it opens.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    Because I have a button to validate the information on one form and the subform is on another form because there is no room..but I just made it so when the one form opens. it opens the other

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Subform Requery
    By MTSPEER in forum Forms
    Replies: 1
    Last Post: 03-12-2015, 08:20 AM
  2. requery subform
    By nswhit in forum Forms
    Replies: 2
    Last Post: 05-16-2013, 09:34 AM
  3. requery in subform
    By putte11 in forum Forms
    Replies: 7
    Last Post: 04-22-2013, 02:43 PM
  4. Replies: 3
    Last Post: 04-17-2012, 10:28 AM
  5. Refresh Requery Subform
    By eww in forum Programming
    Replies: 1
    Last Post: 04-05-2011, 09:19 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