AfterUpdate event not happening until exit of text box

D

datahead22

I have the following code in the after update event of a check box for
some reason the change to the text box is not happening until you tab
past the text box.

Private Sub ckbxoffer_followup1_AfterUpdate()
If Me!ckbxoffer_followup1 = True Then
Me![txtfollowup_deadline] = Format(DateValue(Now()) + 7, "mm/dd/yyyy")
End If
End Sub

I have checked the code and there are no events associated with the
text box.
Any Ideas?
 
A

Allen Browne

Check the Name of the text box. If it is called (say) Text12, you are
altering the field that it is bound to, but not that specific control. As a
result, the control does not get updated until the field change is saved.

BTW, if txtfollowup_deadline is meant to be a date/time value, it might be
better to use:
Me![txtfollowup_deadline] = Date + 7
DateValue(Now()) is the same result as Date.
Format() around a date turns it into a string, and then Access has to turn
it back into a date.
 
D

datahead22

Thank you for the quick response that's what it was I had the label
name not the text box name in the statement. Boy do I feel foolish, oh
well sometimes all it needs is a set of fresh eyes! Thank You!
 

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