AutoUpdate in Subform

  • Thread starter Thread starter phuser
  • Start date Start date
P

phuser

I have a Mainform "Payments" in this form I have 2 unbound fields, "chqdate"
and "chqnum" the subform contains all the unpaid invoices. the AfterUpdate
field in the Subform is the AmountPaid. It does update the fields but the
data isnt updated correctly,
this is what I have for the AfterUpdate Event

Private Sub PaymentAmount_AfterUpdate()

PaymentDate = chqdate
ChequeNumber = chqnum

End Sub

What else do I need to do?
 
phuser said:
I have a Mainform "Payments" in this form I have 2 unbound fields, "chqdate"
and "chqnum" the subform contains all the unpaid invoices. the AfterUpdate
field in the Subform is the AmountPaid. It does update the fields but the
data isnt updated correctly,
this is what I have for the AfterUpdate Event

Private Sub PaymentAmount_AfterUpdate()

PaymentDate = chqdate
ChequeNumber = chqnum

End Sub


That isn't using the values on the main form. It's finding
something in the subform with those names.

To retrieve the vaules from controls on the main form, use
PaymentDate = Me.Parent.chqdate
ChequeNumber = Me.Parent.chqnum

Actually the Me. is optional, but it helps clarify what
object Paremt applies to.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top