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

Me.Parent.Recalc 1

Status
Not open for further replies.

DrillMonkey

Technical User
Sep 29, 2006
64
US
Hi forum,

I have a form/subform one to many realtionship. On my subform I have a field named parcels. On the main form I have a text box named total parcels using this control source.
Code:
=DSum("parcels","tblpurchdata","warehouseid=" & nz([warehouseid],0))
I have this in the after update of the subform
Code:
Private Sub Form_AfterUpdate()
Me.Parent.Recalc
End Sub
This caculates great..but when the user tabs off the parcels field it takes two tries. The parcels field is the last field in the row. It's weird when the user puts a value in the field the cursor moves to the right slighty,then when you tab the focus move back and the focus is now on the value the user typed, then another tab moves the focus to the next empty row like it should. I hope this clear.
 
How are ya DrillMonkey . . .

In the [blue]On Exit[/blue] event of [blue]parcels[/blue] perform the same [blue]ReCalc[/blue] . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
Hi AceMan,

The focus remained on the parcels field, wouldn't even tab off there.
 
DrillMonkey . . .

Disd you disable/delete all intervening code from other sources?

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
 
AceMan..

If you mean in my subform, all I have is the "recalc" the form and subform are imported into a switchboard. If you need to see that code I can provide it..
 

Thanks AceMan,

Got it, I put the Me.Parent.Recalc in the "On Change" of the parcels properties...Wow very fast now. This goes in the tool box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top