What about .Refresh?
What about .Refresh?
Where would that go exactly? If the AfterUpdate event doesn't fire, .Refresh isn't going to be executed,right?
Yah, and both controls are unbound. I was imagining the value was in the table.
I tested the following in the On Exit event.
It worked. Nothing unexpected happened.Code:Private Sub Text0_Exit(Cancel As Integer) Dim dtCalc As Date dtCalc = Me.Text0.Value + 2 Me.Text2.Value = dtCalc End Sub
Then I built a function
and called it in the On ExitCode:Private Function What_Date(dtCalc As Date) dtCalc = Me.Text0.Value + 2 Me.Text2.Value = dtCalc End Function
And that worked too. So, I am still confused.Code:Private Sub Text0_Exit(Cancel As Integer) Call What_Date(Me.Text0.Value) End Sub
Different ways of skinning the same cat, I guess. Thing is, in my simple mind it seems to me if I change whatever is in Box 1 and leave that control, whether via tab or enter or click-somewhere-else or whatever, that ought to trigger an AfterUpdate event where I can do whatever I need to (within reason) to other controls on the same form. In the real world I'm good to go, my workaround is doing what I need, but will keep monitoring this thread to see if anybody else has better ideas or a better grasp of the whole event-sequence logic for Access Forms.
You are going to need to set focus somewhere. On Change won't work because you need a date value. On Dirty might work if it was a bound control.
Bottom line the control does not update until after it loses focus. You need to cause another control to become "Active" and it seems the user will have to cause another control to become active.