ACC97: Uninitialized String in FollowHyperlink Method Causes Err (165191)
The information in this article applies to:
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
MSACCESS caused an invalid page fault in module KERNEL32.DLL
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.
REFERENCES
For more information about the FollowHyperlink method, search the Help
Index for FollowHyperlink method.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbbug kberrmsg kbProgramming kbusage KB165191 |
---|
|