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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

alternative to me.refresh 1

Status
Not open for further replies.

bookouri

IS-IT--Management
Feb 23, 2000
1,464
US
I have a subform where I put a value into a text box, I have an on-change event for that box that causes the box to do a simple calculation on another text box.

private sub text1_change()
me.refresh
me!sum_cost = me!quantity_pulled * me!cost_per_item
me.refresh
end sub

if I leave the refreshes in the sum_cost is updated appropriately, however the quantity_pulled box does some funky business with the select cursor... it will only allow single characters to be entered...unless you click off of the select cursor... anyway... the cursor works fine if I leave out the me.refresh statements.. but the quantity_pulled is not displayed.. is there an alternative to refresh? I tried requery but it did something totally different...

thanks for any suggestions
 
Use the afterUpdate event instead of the change event. Then you can get rid of the me.refresh lines.

Also, you'll probably want to do the same calculation in the Current event of the form, so that that text box has the appropriate value in it when you open the form and when you move from record to record.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Affordable Development, Professionally Done

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top