Groundrush
Registered User.
- Local time
- Today, 17:39
- Joined
- Apr 14, 2002
- Messages
- 1,376
Hi all,
Can anyone help me please?
I'm trying to reference a mobile no from a subform but can't get it to work
Basically a mobile phone no is displayed when a user sends an SMS message which should allow the recipient to reply to it.
I have a table with all the windows login user names along with their mobile no's & it's this information that is referenced when the user sends an SMS message. I have one subform that picks up the windows login name & the other displayes the mobile no linked to the name
I know this method works as I can reference the Username in the SMS message footer
I've then tried but failed to reference the mobile no
Here is the rest of the module code that is being used
Any help would be greatly appreciated... thanks
Can anyone help me please?
I'm trying to reference a mobile no from a subform but can't get it to work
Basically a mobile phone no is displayed when a user sends an SMS message which should allow the recipient to reply to it.
I have a table with all the windows login user names along with their mobile no's & it's this information that is referenced when the user sends an SMS message. I have one subform that picks up the windows login name & the other displayes the mobile no linked to the name
I know this method works as I can reference the Username in the SMS message footer
Code:
strFooter = Replace("-" & [Forms]![frmSMSMessage]![frmUserNameSubform]![txtUserName], " ", "+") '''''''this works if using a subform instead of a listbox
I've then tried but failed to reference the mobile no
Code:
Global Const strClickatell_From = "&from=[Forms]![frmSMSMessage]![frmUserMobileNoSubform]![txtUserMobileNo]"
Here is the rest of the module code that is being used
Code:
Option Compare Database
'Used for Text Messaging interface
Global Const strClickatellURL = "http://api.clickatell.com/http/sendmsg?"
Global Const strAPI_ID = "api_id=*****"
Global Const strClickatell_User = "&user=*****"
Global Const strClickatell_Pass = "&password=*****"
'Global Const strClickatell_From = "&from=447712345678" ''''''Works if only using this generic no
'Global Const strClickatell_From = "&from= Forms!frmSMSMessage!lstUserMobileNo.Column(1)" ''''''tried using a refence to a list box
'Global Const strClickatell_From = "&from= & chr(34)& Forms!frmSMSMessage!lstUserMobileNo.Column(1) & chr(34)"'''''' No compile error but does not work
'Global Const strClickatell_From = & chr(34) & Forms!frmSMSMessage!lstUserMobileNo.Column(1) & chr(34)''''''Compile Error
Global Const strClickatell_From = "&from=[Forms]![frmSMSMessage]![frmUserMobileNoSubform]![txtUserMobileNo]" ' tried the same as the method for the footer below but still does not work
Public Sub SendText2(strMessage As String, strNumber As String)
Dim strBody As String, strFooter As String
strFooter = Replace("-" & [Forms]![frmSMSMessage]![frmUserNameSubform]![txtUserName], " ", "+") '''''''this works if using a subform instead of a listbox
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)
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
Any help would be greatly appreciated... thanks