jonathanchye
Registered User.
- Local time
- Today, 10:43
- Joined
- Mar 8, 2011
- Messages
- 448
Hi all,
Have a very weird problem. I have a form with a subform that is linked via a one-to-many relationship.
On my main form I have a few textboxes with the control source set to DSum the prices on the subform.
My subform is set in datasheet view. I've created an "After Update" event in one of the field to requery the textbox in the mainform.
This works fine but I notice if I am on record no. 5 in the subform for example, when the after update event runs the subform gets refreshed too and I get returned to the first record (but still remain in the same field).
How can I stop this from happening?
So on my mainform the control source of my textbox (txtTotalPrice) is set as :
in the subform I have this in the "After Update" event of the "curPrice" field :
Everytime that after update triggers my whole subform gets refreshed and I get returned to the first record? I don't mind the subform getting refreshed but would prefer not to get returned to first record ...
Have a very weird problem. I have a form with a subform that is linked via a one-to-many relationship.
On my main form I have a few textboxes with the control source set to DSum the prices on the subform.
My subform is set in datasheet view. I've created an "After Update" event in one of the field to requery the textbox in the mainform.
This works fine but I notice if I am on record no. 5 in the subform for example, when the after update event runs the subform gets refreshed too and I get returned to the first record (but still remain in the same field).
How can I stop this from happening?
So on my mainform the control source of my textbox (txtTotalPrice) is set as :
Code:
= DSum("curPrice","tblSubForm", "subformID = " & Me.MainformID)
in the subform I have this in the "After Update" event of the "curPrice" field :
Code:
Forms!frmMainForm.txtTotalPrice.Requery
Everytime that after update triggers my whole subform gets refreshed and I get returned to the first record? I don't mind the subform getting refreshed but would prefer not to get returned to first record ...