Recalculating controls

S

Selçuk Kumbasar

Hi,

I have Access 2007
I have a subform with 3 fields. First one is combo box, others are
calculated.
For the first field there is an "afterupdate" event.

Private Sub Product_AfterUpdate()
[Supplier].Requery
[Unit].Requery
End Sub

It works very well...
But It seems that this code refreshes all calculated controls in all records
in the subform, not the selected record. Any help?

Thanks
 
M

MikeJohnB

Have you tried Refresh?

The Refresh method shows only changes made to records in the current set.
Since the Refresh method doesn't actually requery the database, the current
set won't include records that have been added or exclude records that have
been deleted since the database was last requeried. Nor will it exclude
records that no longer satisfy the criteria of the query or filter. To
requery the database, use the Requery method. When the record source for a
form is requeried, the current set of records will accurately reflect all
data in the record source.

Sorry but I haven't been able to prove the suggestion yet but I hope it helps?

Private Sub Product_AfterUpdate()
Me.Refresh
End Sub

Mike B
--
An Engineers Prayer:
At the very end of the day,
when all else fails,
you have tried all,
you have shouted at and blamed the innocent,
and asked everyone you know,

READ THE INSTRUCTION MANUAL.
 

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