SubForm Wont Requery

D

DS

'm running this code but the Subform "PaymentSubform" won't Requery.
It say that its not supported. I need the Subform to reQuery so that
the Calculated control [PaySum] on the Subform recalculates and the
record is saved.
Thanks
DS


Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
Forms!MoneyOrderPay.Visible = False
Forms!Payment.Visible = True
DoCmd.GoToControl "PaymentSubform"
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.GoToRecord , "", acNewRec
Forms!Payment.[PaymentSubform]![PaymentTypeID] = 10
Forms!Payment.[PaymentSubform]![PaymentAmount] =
Forms!MoneyOrderPay!Text5

Forms!Payment.[PaymentSubform]![DocID] = Forms!MoneyOrderPay!Text0
DoCmd.Close acForm, "MoneyOrderPay"
Forms!Payment.PaymentSubform.Requery
Exit_Command2_Click:
Exit Sub

Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click

End Sub
 
D

DS

DS said:
'm running this code but the Subform "PaymentSubform" won't Requery.
It say that its not supported. I need the Subform to reQuery so that
the Calculated control [PaySum] on the Subform recalculates and the
record is saved.
Thanks
DS


Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
Forms!MoneyOrderPay.Visible = False
Forms!Payment.Visible = True
DoCmd.GoToControl "PaymentSubform"
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.GoToRecord , "", acNewRec
Forms!Payment.[PaymentSubform]![PaymentTypeID] = 10
Forms!Payment.[PaymentSubform]![PaymentAmount] =
Forms!MoneyOrderPay!Text5

Forms!Payment.[PaymentSubform]![DocID] = Forms!MoneyOrderPay!Text0
DoCmd.Close acForm, "MoneyOrderPay"
Forms!Payment.PaymentSubform.Requery
Exit_Command2_Click:
Exit Sub

Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click

End Sub
I added this...
Forms!Payment.PaymentSubform.Form.Requery

Instead of this...
Forms!Payment.PaymentSubform.Requery

and it worked!
DS
 

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

Top