Refresh main form control when subform exited ?

  • Thread starter Thread starter mscertified
  • Start date Start date
M

mscertified

I have a main form containing a subform.
The subform lists checks received and when a new check is entered a 'balance
due' control on the main form needs to be adjusted. I'm having a hard time
getting this to happen. There only seems to be an 'enter' or 'exit' event for
the subform and neither seems to be of much use.
Does anyone know how to do this? Thanks.
 
You should have a calculated control in your subforms footer, i.e.
txtBalance, that calculates the balance, and the control on your main
form should have a control source of;

=[YourSubformControlName].[Form]![txtBalance]

If you use the above method, you shouldn't need to do anything to
refresh the data in the main forms control. Make the calculated control
in the subform invisible if you don't want to see it there.
 
That's exactly what I have and the value in the main form does not refresh
until you click in a control on the main form.
If the user presses the print button before doing this it prints the form
with the wrong amount.
I need the amount value to refresh as soon as you move from the amount field
in the subform.

Beetle said:
You should have a calculated control in your subforms footer, i.e.
txtBalance, that calculates the balance, and the control on your main
form should have a control source of;

=[YourSubformControlName].[Form]![txtBalance]

If you use the above method, you shouldn't need to do anything to
refresh the data in the main forms control. Make the calculated control
in the subform invisible if you don't want to see it there.
--
_________

Sean Bailey


mscertified said:
I have a main form containing a subform.
The subform lists checks received and when a new check is entered a 'balance
due' control on the main form needs to be adjusted. I'm having a hard time
getting this to happen. There only seems to be an 'enter' or 'exit' event for
the subform and neither seems to be of much use.
Does anyone know how to do this? Thanks.
 
I did some more checking and here is what happens...
If you enter a new row in the subform and then go to enter another row, the
main form updates with the first row.
If you delete a row in the subform, the main form value updates immediately.
However, if you enter a single new row in the subform and then go back to
the main form, no update occurs until you click in a control.

-Dorian

mscertified said:
That's exactly what I have and the value in the main form does not refresh
until you click in a control on the main form.
If the user presses the print button before doing this it prints the form
with the wrong amount.
I need the amount value to refresh as soon as you move from the amount field
in the subform.

Beetle said:
You should have a calculated control in your subforms footer, i.e.
txtBalance, that calculates the balance, and the control on your main
form should have a control source of;

=[YourSubformControlName].[Form]![txtBalance]

If you use the above method, you shouldn't need to do anything to
refresh the data in the main forms control. Make the calculated control
in the subform invisible if you don't want to see it there.
--
_________

Sean Bailey


mscertified said:
I have a main form containing a subform.
The subform lists checks received and when a new check is entered a 'balance
due' control on the main form needs to be adjusted. I'm having a hard time
getting this to happen. There only seems to be an 'enter' or 'exit' event for
the subform and neither seems to be of much use.
Does anyone know how to do this? Thanks.
 
Back
Top