ACC97: Uninitialized String in FollowHyperlink Method Causes Err (165191)



The information in this article applies to:

  • Microsoft Access 97

This article was previously published under Q165191
Moderate: Requires basic macro, coding, and interoperability skills.

SYMPTOMS

When you use the FollowHyperlink method of the Application object, you receive one of the following error messages:
Run-time error '28': Out of stack space

-or-

MSACCESS caused an invalid page fault in module KERNEL32.DLL

-or-

MSACCESS caused an invalid page fault in module MSACCESS.EXE
The latter two error messages cause Microsoft Access to shut down.

This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to the "Building Applications with Microsoft Access 97" manual.

CAUSE

You may be using an uninitialized string variable in the Address argument of the FollowHyperlink method.

RESOLUTION

Write your procedure to initialize the string variable, or check its value before you call the FollowHyperlink method.

The following code sample initializes the string variable to an empty string initially, which prevents an error if the variable is not reset elsewhere in the procedure:
   Sub NoCrash()
      Dim st As String
      st = ""
      ' More code goes here that should ultimately
      ' reset the st variable to a valid hyperlink
      ' address.
      Application.FollowHyperlink st
   End Sub
				
The next sample procedure checks the value of the string variable before passing it to the FollowHyperlink method:
   Sub OpenWebPage()
      Dim st As String
      ' More code goes here that should set the
      ' st variable to a valid hyperlink
      ' address.
      If st = "" Then
         Msgbox "You must set the st variable to a valid string."
      Else
         Application.FollowHyperlink st
      End If
   End Sub
				

STATUS

Microsoft has confirmed this to be a problem in Microsoft Access 97. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

WARNING: Following these steps will cause a page fault on your computer. Make sure you save and close any open work on your computer before following these steps.
  1. Start Microsoft Access and open the sample database Northwind.mdb.
  2. Create a new module and type the following procedure:
          Sub CrashMe()
             Dim st As String
             Application.FollowHyperlink st
          End Sub
    						
  3. To test this procedure, type the following line in the Debug window, and then press ENTER.

    CrashMe

    Note that you receive one of the errors listed at the beginning of this article.

REFERENCES

For more information about the FollowHyperlink method, search the Help Index for FollowHyperlink method.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbbug kberrmsg kbProgramming kbusage KB165191