Results 1 to 5 of 5
  • Thread Tools
  1. Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Requery a list on form from a subform (2000)

    Hi All,

    I have a form called frmAccountsReceivable. This form contains a subform call sfrmPayment. I would like to requery a list on frmAccountsReceivable after updating a textbox on sfrmPayment. I'm not sure how to code this.

    Thanks,
    Leesha

  2. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: Requery a list on form from a subform (2000)

    To refer to the main form from the subform, you can use Parent. So you'd get something like this:

    Private Sub txtSomething_AfterUpdate()
    Me.Parent.lstOther.Requery
    End Sub

  3. Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Requery a list on form from a subform (2000)

    Hi Hans,

    Thanks for the quick response. Would I use the same code if the after update is in a subform that is in a subform on the parent form?

    Parent form = frmAccountsReceivable
    frmPayment is a subform frmAccountsReceivable
    within frmPayment is sfrmPaymentAllocations which is where the actual requery of lstEdit (on frmAccountsReceivable) should be happening.

    Not sure if that makes sense.

    Leesha

  4. Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 10 Times in 10 Posts

    Re: Requery a list on form from a subform (2000)

    Since you want to requery a list box from two levels down, you would need Parent twice to refer to something on the main form.

    Me.Parent.Parent.lstOther.Requery

  5. Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Requery a list on form from a subform (2000)

    Thanks Hans!!!

    Leesha

Posting Permissions

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