sub or function not defined

  • Thread starter Thread starter tlaker
  • Start date Start date
T

tlaker

2 computers, ME and 2000, both running Access 2000. Usurped some code from
"Access 2003 Inside Out" to convert e-mail addresses from http:// to mailto.
This is what I used:

Private Sub EmailName_AfterUpdate()

Dim IntI as Integer

If IsNothing(Me.EmailName) Then Exit Sub

Me.EmailName = Replace(Me.EmailName,"http://"', "mailto:")

End If

End Sub.



This works fine on my ME computer, but on the 2000, I get "Compile error
sub or function not defined" and IsNothing is highlighted. Is there
something about Windows 2000 that is different or is my code wrong for 2000?
Thanks
 
in message:
2 computers, ME and 2000, both running Access 2000. Usurped some code from
"Access 2003 Inside Out" to convert e-mail addresses from http:// to mailto.
This is what I used:

Private Sub EmailName_AfterUpdate()

Dim IntI as Integer

If IsNothing(Me.EmailName) Then Exit Sub

Me.EmailName = Replace(Me.EmailName,"http://"', "mailto:")

End If

End Sub.



This works fine on my ME computer, but on the 2000, I get "Compile error
sub or function not defined" and IsNothing is highlighted. Is there
something about Windows 2000 that is different or is my code wrong for 2000?
Thanks

IsNothing is a custom procedure that John Viescas wrote. It is not a built-in
Access function or sub. The procedure should be in one of the modules from
John's book. You will need to import that code into each database that you
wish to use the IsNothing function.
 
Jeff Conrad said:
in message:


IsNothing is a custom procedure that John Viescas wrote. It is not a built-in
Access function or sub. The procedure should be in one of the modules from
John's book. You will need to import that code into each database that you
wish to use the IsNothing function.
Actually, I entered the code on my home pc (windows ME) and it worked fine,
I didn't build a module ( I dunno, I'm a novice), I just entered the code in
the code builder. When it worked on my home pc, I copied the entire access
2000 thingie and saved it onto the office pc, windows 2000. That's when it
didn't work. I checked my home edition and there is no module in the module
file. Sooooooo, is there built in code that would replace "http://" with
"mailto:" only when [emailName] has an entry that I could use?
 
in message:
Actually, I entered the code on my home pc (windows ME) and it worked fine,
I didn't build a module ( I dunno, I'm a novice), I just entered the code in
the code builder. When it worked on my home pc, I copied the entire access
2000 thingie and saved it onto the office pc, windows 2000. That's when it
didn't work. I checked my home edition and there is no module in the module
file. Sooooooo, is there built in code that would replace "http://" with
"mailto:" only when [emailName] has an entry that I could use?

The IsNothing function will work you just need to make sure it exists
in the database at the office. Things to try:

1. On the office database (not the home one) open any module in
Design View. (If you do not have any, just create a new one). Go
to Edit | Find on the toolbar. In the "Find What" box enter IsNothing.
In the Search area select "Current Database" and then hit the "Find Next"
button. This will search the entire database for all instances of IsNothing.
Please make a note of all instances where (if any) it was found and then
post back. I'm guessing you will have some instances in form/reports, but not
in any modules.

2. Go to John's site and download the IsNothing function.
(Make a backup before beginning)
- Go here: http://www.viescas.com/Info/links.htm
- It may be in all I'm not sure, but download the wedding database
- Convert it to your 2000 version
- Open *your* database and go to
File | Get External Data | Import from the main Access window.
- Navigate to John's wedding database and select the file. Import
just the module called modUtility
- **Immediately** compile your database before doing anything else
Open any module in Design view and then select Debug | Compile.
- Fix any compile errors Access finds.
- Compact the database.

The code should now work fine.
 
Thanks, Jeff, I'll give it a try and see....appreciate the info
Jeff Conrad said:
in message:
Actually, I entered the code on my home pc (windows ME) and it worked fine,
I didn't build a module ( I dunno, I'm a novice), I just entered the code in
the code builder. When it worked on my home pc, I copied the entire access
2000 thingie and saved it onto the office pc, windows 2000. That's when it
didn't work. I checked my home edition and there is no module in the module
file. Sooooooo, is there built in code that would replace "http://" with
"mailto:" only when [emailName] has an entry that I could use?

The IsNothing function will work you just need to make sure it exists
in the database at the office. Things to try:

1. On the office database (not the home one) open any module in
Design View. (If you do not have any, just create a new one). Go
to Edit | Find on the toolbar. In the "Find What" box enter IsNothing.
In the Search area select "Current Database" and then hit the "Find Next"
button. This will search the entire database for all instances of IsNothing.
Please make a note of all instances where (if any) it was found and then
post back. I'm guessing you will have some instances in form/reports, but not
in any modules.

2. Go to John's site and download the IsNothing function.
(Make a backup before beginning)
- Go here: http://www.viescas.com/Info/links.htm
- It may be in all I'm not sure, but download the wedding database
- Convert it to your 2000 version
- Open *your* database and go to
File | Get External Data | Import from the main Access window.
- Navigate to John's wedding database and select the file. Import
just the module called modUtility
- **Immediately** compile your database before doing anything else
Open any module in Design view and then select Debug | Compile.
- Fix any compile errors Access finds.
- Compact the database.

The code should now work fine.
 
Back
Top