Hyperlink on command button problem

K

Keith

Thank you very much !!!!! This definately did the trick
I must mention though, I'm running a modest 3GHz CPU, and it didn't work at
first.
That pause is crutial to the whole system, because as soon as we hit END
FUNCTION, the internet control object is obliterated from memory.

There must be a way to get a message from the IE contol system when it is
done, with or without error.

I increased your 1000 loop to 10000, it makes a 2 second pause, which seems
to be enough to get the message out and the closes off properly. Thanks,
nice short code. I can easily go on from here.

Keith



I wrote an article about this and it's out at Database Journal site.
There's a
sample code download too. Pretty easy to do ... just a few lines of code.

http://www.databasejournal.com/features/msaccess/article.php/3491216
 
K

Keith

This was a simple send SMS app
And for now, I modified your tutorial to this ... if anybody else was
interested in the thread

Private Sub BTN_Send_Click()
Dim WebSite As String

WebSite = "http://www.telkom.co.za/resellers/telkom.asp"
If IsNull(Message) Then Exit Sub
If IsNull(Cel_No) Then Exit Sub
If SendSMS(WebSite, Cel_No, Message) Then
MsgBox "ERROR ERROR ERROR", vbCritical, "ERROR"
Else
MsgBox "Message Sent", vbDefaultButton1
End If
End Sub

Function SendSMS(Site As String, CelNumber As String, Message As String) As
Long
On Error Resume Next

Dim objDoc As SHDocVw.InternetExplorer, url As String
Dim i As Integer, j As Integer

Set objDoc = New SHDocVw.InternetExplorer

url = Site & "?" & "SMSNo=" & CelNumber & "&Message=" & Message &
"&Store=Mark" & Chr(13)
Debug.Print url
objDoc.Navigate url, , , True

' Need something to pause execution while URL is hit.
' The reason why this pause is so imprtant is because as soon as we hit
END FUNCTION below, the entire internet contol object is cleared from memory

For i = 0 To 10000 '''' this value will always have to increse as the
hardware gets faster
j = DCount("*", "MsysObjects")
Next

SendSMS = Err.Number
End Function
 
D

Danny J. Lesandrini

Thanks for the improvement. Haven't had time to look at it closely yet, but
I'll give it attention when I get some time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top