update textfield on mainform from subform

harrym

New member
Local time
Today, 19:08
Joined
Apr 2, 2011
Messages
10
I have a form CashBook with the subform subCashBook
On the mainform i have a textfield to get the actual cash amount
I programed CashDate on the mainform with setfocus to get the exact amount from the tblCashBook.
I tried everything to change the textbox with the new amount after entering paid and received amounts the box never changed to the new amount.
I have to setfocus to cashdate and get the new amount
What I do wrong?
 
Hi
Have tried all this
Forms!frmCashBook!txt13.requery
Forms!Mainform!txt13.requery
Me.Parent.Parent!txt13.requery
Me.Parent!txt13.requery
Forms!frmCashBook!frmSubCashBook.Form!txt13.requery
but not working

To explain u some details

Txt13 is an unbound field on the Mainform frmCashBook the Cash entries (paid and received cash money) are done on the subform frmSubCashBook
The mainform is related to the tblNewCashDate which is related to the field CashDate on the table tblCashBook
The afterUpdate on the field Pagado has this code
Dim curX As Currency
curX = DSum("[Entrada]", "tblCashBook") - DSum("[Pagado]", "tblCashBook")
Text13 = curX
I have to set the pointer to CashDate to get the unbound field updated
CashDate has the same code as the field Pagado
Dim curX As Currency
curX = DSum("[Entrada]", "tblCashBook") - DSum("[Pagado]", "tblCashBook")
Text13 = curX
 
*Unbound* controls do not Requery and it is not likely you want Requery anyway. You have referred to two different controls, txt13 and Text13. Which is it?
 
Set the ControlSource of the txt13 TextBox to:
=DSum("[Entrada]", "tblCashBook") - DSum("[Pagado]", "tblCashBook")
...and see what happens.
 
Opening the form I got the Cash
Entering some records in the subform nothing changes on the unbound field.
 
Try putting:
Me.Parent.txt13.Recalc
...in the CurrentEvent of the SubForm.
 
Run-time error 438
Object doesn't suppoort this property or method
 
Try:
Me.Parent.txt13.Refresh
...or...
Me.Parent.Recalc
 

Users who are viewing this thread

Back
Top Bottom