Why does this code not work?

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
 
G

Guest

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.
 
G

Guest

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.
 
S

Stefan Hoffmann

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 <--
 

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