Why does this code not work?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This code is in a subform. The problem is that the
Me!EmailCC = Me!EmailCC.OldValue
does not put back the original value.

Private Sub EmailCC_BeforeUpdate(Cancel As Integer)
On Error Resume Next
If Nz(Trim(Me!EmailCC), vbNullString) = vbNullString Then
MsgBox "Email address cannot be blank." & vbCrLf & _
"If you want to delete the email address, select the line by
clicking" & _
" in the leftmost column, then press the 'Delete' key", ,
"Warning"
Me!EmailCC = Me!EmailCC.OldValue
Cancel = 1
Exit Sub
End If
End Sub
 
If you are using the newest version of ms access then an article I read says
that the ".OldValue" routine does not work in the 2007 version of Access.
You can Google "Access 2007" and "Problems" to find the same article.
 
I'm using Access 2003.

Fynder said:
If you are using the newest version of ms access then an article I read says
that the ".OldValue" routine does not work in the 2007 version of Access.
You can Google "Access 2007" and "Problems" to find the same article.
 
hi,
This code is in a subform. The problem is that the
Me!EmailCC = Me!EmailCC.OldValue
does not put back the original value.

Private Sub EmailCC_BeforeUpdate(Cancel As Integer)
It's imho the wrong event. Use AfterUpdate instead.


mfG
--> stefan <--
 
Back
Top