My code

G

Guest

Can you tell me what is wrong with "IsNothing" in my code?

Private Sub Email_AfterUpdate()
' If you just type in an email name: (e-mail address removed)
' Access changes it to: [email protected]#http://[email protected]# !!
' This code tries to fix it
Dim intI As Integer
' Don't do anything if email is empty
If IsNothing(Me.PMemailAddress) Then Exit Sub
' Fix up http:// if it's there
Me.PMemailAddress = Replace(Me.PMemailAddress, "http://", "mailto:")
' Now look for the first"#" that delimits the hyperlink display name
intI = InStr(Me.PMemailAddress, "#")
' And put the person name there instead if found
If intI > 0 Then
Me.PMemailAddress = (Me.PMemailAddress + " ") & Me.LastName & _
Mid(Me.PMemailAddress, intI)
End If
End Sub
 
M

missinglinq via AccessMonster.com

Right off hand, IsNothing() is not an Access function! I suspect you want
IsNull()
 
G

Guest

You were right, Null is the right function. Now the second to last line is
giving me an error:

f intI > 0 Then
Me.PMemailAddress = (Me.PMemailAddress + " ") & Me.LastName & _
Mid(Me.PMemailAddress, intI)

It's telling me that .PMemailAddress is a Compile error: Method or data
member not found. What does that mean? It doesn't have a problem with it in
5 previous times it shows up, in the same code? I don't get it?

Freehal
 
M

missinglinq via AccessMonster.com

The thing you have to understand is that Access frequently hilites not the
line causing the problem, but the line FOLLOWING the line causing the problem.
If you've accurately copied and pasted your code here, the problem is you
have

f intI > 0 Then

when you should have

If intI > 0 Then

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 

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

Similar Threads

What's up with this??? 6
sub or function not defined 5
space in word 1
Can't make sense of this 3
Read A Text File 2
GetMultipleFiles Function 2
Errorcode 2108 1
Is the Progress bar Slowing Down my code? 1

Top