SMS (Text Message) from Access (1 Viewer)

jamesormi

Registered User.
Local time
Today, 06:12
Joined
Nov 19, 2008
Messages
20
Hi,

Is there a way to send a SMS (Text Message) from Access 2007?

Any example would be greatly appreciated.

Thanks in advance.
 

Groundrush

Registered User.
Local time
Today, 06:12
Joined
Apr 14, 2002
Messages
1,376
I can using access 2003, I use a company called clickatell.com for my sms credits.

here is an example of the code I used on my application


Code:
Option Compare Database
'Used for Text Messaging interface
Global Const strClickatellURL = "http://api.clickatell.com/http/sendmsg?"
Global Const strAPI_ID = "api_id=****"   'replace <api_id> with your API ID
Global Const strClickatell_User = "&user=****"    'replace <UserID> with your clickatell userid
Global Const strClickatell_Pass = "&password=****"  'replace <password> with your password
Global Const strClickatell_From = "&from=447*64**38**" 'Replace <whofrom> with name of co etc, 11 chars max
Public Sub SendText1(strMessage As String, strNumber As String)

    'Function Name:  SendText
    'Purpose:  This function formats a string (strMessage) ready for sending via SMS, and then sends it
    'by using a HTTP post (OpenURL).
    '
    'This service requires an active account with Clickatell.com, with active credits.
    'You must pass through the API ID, Clickatell Username AND Password for it to work.
    'Full details are available on Clickatell.com
    '
    'Function created by Adam Taylor - adaytay on UA, July 2006.
    
    'If Len(strMessage) = 0 Then Exit Sub
   ' If Len(strMessage) > 160 Then
       ' MsgBox "Message is too long - maximum 160 characters (including spaces)" & vbCrLf _
       ' & "Your message is currently " & Len(strMessage) & " characters", vbOKOnly + vbExclamation, _
       ' "Too long!"
       ' Exit Sub
    'End If
    
    Dim strBody As String, strFooter As String
    
    'I liked to add a footer to the text message here as we used this to text clients
    'strFooter = Replace("*Job order", " ", "+")
    
    strFooter = Replace("-" & [Forms]![frmTimerecordEdit]![txtUser], " ", "+")
    
    strBody = strClickatellURL & strAPI_ID & strClickatell_User & strClickatell_Pass & strClickatell_From
    
    'Modify the format of the message and check the number is in the right format...
    strMessage = Replace(strMessage, " ", "+")
    strMessage = Replace(strMessage, "&", "and")
    strNumber = Replace(strNumber, " ", "")
    If Left(strNumber, 1) = "0" Then strNumber = "44" & Mid(strNumber, 2, 99)
    
    'All built and ready... now get the message ready to send..
    
    strBody = strBody & "&to=" & strNumber & "&text=" & strMessage & strFooter
    
    DoEvents
    
    If Not OpenURL(strBody) Then
        MsgBox "Sorry, there was a problem when attempting to send the message", vbOKOnly + vbInformation, "Could not connect to internet"
   End If
   'Resume
End Sub

Public Function OpenURL(strURL As String) As Boolean

'This function will open a specified URL as a hidden application, then once the page has loaded,
'it will immediately close the page (used to send message to internet)
'Originally by Oli S (Freakazeud), tweaked by Adam Taylor, adaytay@UA, 21 April 2006

On Error GoTo SendFailure

    Dim Shell, IE
    
    Set Shell = CreateObject("Wscript.Shell")
    Set IE = CreateObject("InternetExplorer.Application")
    
    With IE
        .Visible = False
        .Silent = True
        .Navigate (strURL)
        While .Busy
        Wend
    End With
    IE.Quit
    Set IE = Nothing
    Set Shell = Nothing
    
    DoEvents
    
    OpenURL = True

    Exit Function
    
SendFailure:

    OpenURL = False
    
End Function
 

darbid

Registered User.
Local time
Today, 07:12
Joined
Jun 26, 2008
Messages
1,428
Hi,

Is there a way to send a SMS (Text Message) from Access 2007?

Any example would be greatly appreciated.

Thanks in advance.

Here is a question in the forum about using skype.

http://www.access-programmers.co.uk/forums/showthread.php?t=193837&highlight=skype


As an alternative VBA and thus Access can also make HTTP calls. This opens up any SMS API which is used by people building websites who want to send sms.

For example
http://www.clickatell.com/developers/api_http.php

From VBA you could post http with the necessary information in it.

edit: Oh it helps to read previous posts. My second suggestion is the same as above. Sorry
 

darbid

Registered User.
Local time
Today, 07:12
Joined
Jun 26, 2008
Messages
1,428
By the way I recently read a new way to send free SMS.

You need to know the receivers company to do it.

Code:
Receivers_Phone_Number@[their carriers URL]
Eg to send to AT&T you would use

5559546825@txt.att.net
 

Natashawilliams

New member
Local time
Yesterday, 22:12
Joined
Feb 24, 2017
Messages
1
Sending bulk SMS directly from access is quite easy with the help of SMS Addons. SMS Providers offer free or paid SMS Addons or plugin to send directly from the place where your database exist
 

Users who are viewing this thread

Top Bottom