PC Review


Reply
Thread Tools Rate Thread

Converting Varchar Hyperlink address from SQL Server to real hyperlink in MS Access

 
 
FA
Guest
Posts: n/a
 
      24th Jan 2006
I am using the following code to convert my a url address which is in
Varchar in SQL Server DB into hyperlink since my database is on SQL
Server and there is no such field as MS Access 's HyperLink in SQL
Server 2000
My field name is URL1
and in the DoubleClick Event i have =Connect()

The following functions getting the complire error " Invalide use of Me
on both Me.hwnd and Me.URL"
I added the Shell Library into my references but still getting the same
error

Please help what should i do ?


Public Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) _
As Long
Public Sub Connect(strURL As String)
On Error GoTo Connect_Error

Dim StartDoc As Long
If Not IsNull(strURL) Then
StartDoc = ShellExecute(Me.hwnd, "open", Me.URL, _
"", "C:\", SW_SHOWNORMAL)
End If

Exit Sub

Connect_Error:
MsgBox "Error: " & Err & " " & Error
Exit Sub
End Sub

 
Reply With Quote
 
 
 
 
John Nurick
Guest
Posts: n/a
 
      25th Jan 2006
There are several things wrong with your code, but what you seem to be
trying to do is much more easily done with something like this, where
XXX is the name of the textbox that's displaying the URL:

Private Sub XXX_Double_Click(Cancel As Integer)
Application.FollowHyperlink Me.XXX.Value
End Sub

In the properties sheet, On DoubleClick must be set to [Event
Procedure].




On 24 Jan 2006 14:14:42 -0800, "FA" <(E-Mail Removed)> wrote:

>I am using the following code to convert my a url address which is in
>Varchar in SQL Server DB into hyperlink since my database is on SQL
>Server and there is no such field as MS Access 's HyperLink in SQL
>Server 2000
>My field name is URL1
>and in the DoubleClick Event i have =Connect()
>
>The following functions getting the complire error " Invalide use of Me
>on both Me.hwnd and Me.URL"
>I added the Shell Library into my references but still getting the same
>error
>
>Please help what should i do ?
>
>
>Public Declare Function ShellExecute Lib "shell32.dll" Alias
>"ShellExecuteA" _
> (ByVal hwnd As Long, _
> ByVal lpOperation As String, _
> ByVal lpFile As String, _
> ByVal lpParameters As String, _
> ByVal lpDirectory As String, _
> ByVal nShowCmd As Long) _
>As Long
>Public Sub Connect(strURL As String)
>On Error GoTo Connect_Error
>
> Dim StartDoc As Long
> If Not IsNull(strURL) Then
> StartDoc = ShellExecute(Me.hwnd, "open", Me.URL, _
> "", "C:\", SW_SHOWNORMAL)
> End If
>
> Exit Sub
>
>Connect_Error:
> MsgBox "Error: " & Err & " " & Error
> Exit Sub
>End Sub
>


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.

 
Reply With Quote
 
FA
Guest
Posts: n/a
 
      25th Jan 2006
It works in the textbox, but i want to show them as hot hyperlink (Blue
Color) on reports as well. I dont know how would we go about achieving
that?

Thanks for your reply

Moe

 
Reply With Quote
 
John Nurick
Guest
Posts: n/a
 
      25th Jan 2006
Format the textboxes in question with blue underlined text.

On 25 Jan 2006 09:47:59 -0800, "FA" <(E-Mail Removed)> wrote:

>It works in the textbox, but i want to show them as hot hyperlink (Blue
>Color) on reports as well. I dont know how would we go about achieving
>that?
>
>Thanks for your reply
>
>Moe
>


--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting hyperlink to actual web address Roger on Excel Microsoft Excel Misc 9 29th Oct 2008 12:25 AM
Converting Hyperlink formulae to real hyperlink Darin Kramer Microsoft Excel Programming 5 20th Sep 2007 04:45 PM
Insert Hyperlink: wrong hyperlink in outlook web access =?Utf-8?B?UGF0cmlrIEx1Y2E=?= Microsoft Outlook Discussion 1 14th Jul 2007 12:11 AM
Moving rows with Hyperlink doesn't move hyperlink address =?Utf-8?B?U2FtYWQ=?= Microsoft Excel Misc 15 22nd Jun 2006 12:03 PM
reading html when hyperlink address not hyperlink text diplayed =?Utf-8?B?S2V2aW4=?= Microsoft Excel Programming 1 4th Dec 2003 10:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:45 AM.