Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recalculate field after changing a textbox value

Status
Not open for further replies.

jappe22

Technical User
Sep 25, 2006
9
NL
I think it should be very simple, what i am trying to do...

I have a a calculated textbox which uses a formula (VBA) to calculate a numeric value.

One of the inputs of the inputs needed for that calculated field is textbox1. Default value = 0 and when i change it to 30 i want the calculated field to update immediately or at least after the focus of the textbox1 is lost.

Now it only updates the calculated field when i check another checkbox for example.

Anybody?
 
In the AfterUpdate event procedure of textbox1:
Me![calculated control].Requery

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
It helped, thanx, but u still have to hit enter in textbox1 before it updates the calculated field.
 
How are ya jappe22 . . .

There's no way for access to know when you've finished data entry other than thru an event, which occurs when the focus is leaving the control. Events are:
[ol][li]BeforeUpdate[/li]
[li]AfterUpdate[/li]
[li]OnExit[/li]
[li]OnLostFocus[/li][/ol]
There is also an [blue]OnChange[/blue] event you can play with . . .

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top