# Database Discussions > Microsoft Access >  Update text box on main form afterupdate of subform

## Thantos Hess

I have a text box located on the main form.  I would like to requery the total given in the text box (based on a query) on the AfterUpdate event of a subform.  I have a second subform that uses the same query and can get it to update fine, but the text box will requery the entire form.  This would not be a problem, but the user can enter time for previous days, and therefore the requery moves the previous days records to the chronological order.  

The short, is on an AfterUpdate event on the subform, how can I requery just the text box on the main form?

Thanks in advance

----------


## GolferGuy

> how can I requery just the text box on the main form?




```
Me.Parent!JustTheOneField.ReQuery
```

----------


## Thantos Hess

GolferGuy I appreciate that, however it still requeries the entire form (form and subforms).  The text box is based on the data input into one of the subforms, and if it gets requeried, it will move the records in the subform.

----------


## GolferGuy

It sounds like you are putting a total (total time entered so far maybe?).  So, you can use "DSum" to calculate that total for you.

```
Me.Parent!JustTheOneField = DSum("YouTableFieldName", "YourTableName", "YourCriteria")
```

YourTableFieldName is the field you need to sum, YourTableName is the name of the table, or query that has the field in it, and YourCriteria is the criteria to select only the records you want included in the sum.  
If you will be using all the records from the set you are using (table or query) then you don't need to include any criteria.  The DSum will just use all the records in the set of records you name in the "YourTableName" parameter.

----------


## Thantos Hess

Brilliantly simple...

I was using a DSum() and had it as the recordsource.  I had just overlooked the fact that I could control the value from VBA, rather than requering the recordsource.  I moved the DSum() to the default value and added your code to the After Update event on the subform and it works flawlessly.

Thank you so much!

----------


## GolferGuy

Glad it's working.

----------

