Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / June 2007

Tip: Looking for answers? Try searching our database.

My code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Freehal04 - 19 Jun 2007 01:16 GMT
Can you tell me what is wrong with "IsNothing" in my code?

Private Sub Email_AfterUpdate()
' If you just type in an email name: Somebody@hotmail.com
' Access changes it to: Somebody@hotmail.com#http://somebody@hotmail.com# !!
' 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
missinglinq - 19 Jun 2007 02:31 GMT
Right off hand, IsNothing() is not an Access function! I suspect you want
IsNull()

Signature

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

Answers/posts based on Access 2000

Freehal04 - 19 Jun 2007 16:54 GMT
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

> Right off hand, IsNothing() is not an Access function! I suspect you want
> IsNull()
missinglinq - 19 Jun 2007 18:55 GMT
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

Signature

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

Answers/posts based on Access 2000

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.