Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2011
    Posts
    83

    Unanswered: Requery a continuous form

    I have a continuous form that I want to requery. Is this possible?

    At the moment all I can do is close the form and re open it which takes too long and looks poor.

    Any ideas?

  2. #2
    Join Date
    Dec 2010
    Posts
    31
    Forms have a requery method that you can use for this very purpose. At the very least you could have code that looks like:

    Me.Requery

    But I suspect that this continuous form is a subform? If so, then let's say your main form is named "frmMain" and the control where your subform is is called "frmSub", then you would requery the subform like so:

    Forms![frmMain]![frmSub].Form.Requery

    I hope that helps.

  3. #3
    Join Date
    Jan 2011
    Posts
    83
    It is not a sub form.

    I have a frmMain form (continuous) which has a command button named "CRITERIA". This then opens a smaller form (popup) over the top of main form.

    The user can then select criteria within the popup. When I click the APPLY command button on the pop up, the SQL string for the underlying query for frmMain changes.

    I then want to close popup and requery frmMain. This is where I am struggling.

    CurrentDb.QueryDefs("qryStockLevels").SQL = strSQL
    Forms!frmPopUp.Visible = False
    Forms!frmMain.Form.Requery

    This does not work and the frmMain does not requery but the underlying query does change!

  4. #4
    Join Date
    Dec 2010
    Posts
    31
    Try it like this and see if it helps:

    Forms![frmMain].Requery

  5. #5
    Join Date
    Jan 2011
    Posts
    83
    The underlying query has changed but the frmMain has not changed

  6. #6
    Join Date
    Dec 2010
    Posts
    31
    Why do you make the popup form invisible instead of closing it? Just for giggles, requery your main form and then close the popup.

  7. #7
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Place Me.Requery in the Form_Activate sub.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  8. #8
    Join Date
    Jan 2011
    Posts
    83
    I have done both of the above with no joy.

    I now requery the frmMain before and after I close the popup.

    The frmMain also has me.requery in the onActivate event.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •