Full Version: AfterUpdate event will not work!!
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
Alpha7
I have a form with a text box on it. The text box is bound to a field in the table on which the form is based. Nothing special there.

However, when I put the following code on the AfterUpdate event, it just fails to work. Nothing happens, and the message box does not appear. I know this code works, because it works on other controls.


Private Sub TextField_AfterUpdate()
If IsNull(Me.TextField) Then
MsgBox "This is a test.", vbExclamation, "Test"
End If
End Sub

Thanks.

UPDATE: If I change the data type from Memo to Text then it works. Am I not able to use this code on a memo field then?!

Edited by: Alpha7 on Thu Dec 1 10:34:15 EST 2005.
dashiellx2000
There may actually be something in the text box that will not evaluate to null. Is there a defualt value on the bound table? Also you may want to try:

CODE
If IsNull(Me.TextField) or Me.TextField = "" Then
MsgBox "This is a test.", vbExclamation, "Test"
End If
End Sub


I also had a similar problem some time back. Check out this thread to get some more advice to diagnose the issue.

HTH.
niesz
Just for fun, try

If Nz(Me.TextField) = "" Then

and let us know if this still happens.
Alpha7
Hi,

I tried your suggestion about Me.TextField = "" and this seems to have worked. I think you are right about the empty memo field not equating to Null.

Many thanks for your help.
dashiellx2000
Glad I could help. Good luck with your project.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.