Results 1 to 4 of 4
  1. #1
    curnil is offline Novice
    Windows XP Access 97
    Join Date
    Mar 2010
    Posts
    2

    Unhappy Help with functions / procedures

    Hi I'm trying to use a stored function to update a twitter account from my db.

    Here is the stored function;

    Public Function Twitter_Live(Listing As Integer, JOBNUM, JOBSTREET, JOBOFFICE)
    Dim Twitter, xml, tUsername, tPassword, tStatus, tResult



    Set xml = CreateObject("MSXML2.XMLHTTP")
    'get the username entered by you in named range tusername
    tUsername = "xxxxxx"
    'get the password entered by you in named range tpasswd
    tPassword = "xxxxxx"
    'get the message entered by you in named range tmessage
    tStatus = "just photographed " & JOBNUM & " " & JOBSTREET & " for " & JOBOFFICE & ". "
    tStatus = tStatus & http://www.xyv.com/ & Listing
    xml.Open "POST", "http://" & tUsername & ":" & tPassword & "@twitter.com/statuses/update.xml?status=" & tStatus, False
    xml.setRequestHeader "Content-Type", "content=text/html; charset=iso-8859-1"
    xml.Send
    tResult = xml.responsetext 'you can view Twitter’s response in debug window
    Debug.Print tResult
    Set xml = Nothing



    End Function


    and here is the code from the form;

    Private Sub BtnLive_Click()
    Me.JobStatus = "L"
    Me.JobLiveDate = Now()
    Me.Requery
    Twitter_Live(Me.JOBID, Me.JOBNUM, Me.JOBSTREET, Me.OfficeDisplayName)
    End Sub

    I get and error where it is expecting an '='

    I'm not sure why.

    Any help much appreciated.

    Cheers
    Nathan

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    On what line? As a shot in the dark, I wonder if the web address here should be in quotes:

    tStatus = tStatus & http://www.xyv.com/ & Listing
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    curnil is offline Novice
    Windows XP Access 97
    Join Date
    Mar 2010
    Posts
    2
    Sorry, on the line where I callc the subroutine.


    Private Sub BtnLive_Click()
    Me.JobStatus = "L"
    Me.JobLiveDate = Now()
    Me.Requery
    Twitter_Live (Me.JOBID, Me.JOBNUM, Me.JOBSTREET, Me.OfficeDisplayName)
    End Sub

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Sorry, got sidetracked. It's not the error I'd expect, but when you don't use the Call statement, you aren't supposed to use the parentheses around the arguments. Try without those (or adding the Call statement). If that doesn't help, can you post the db, or a representative sample?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Sorting and creating functions
    By BUS 101 in forum Access
    Replies: 1
    Last Post: 09-15-2009, 02:13 PM
  2. Replies: 0
    Last Post: 01-08-2009, 05:49 PM
  3. Concatenation, nested IIF functions
    By krymer in forum Queries
    Replies: 2
    Last Post: 10-20-2008, 07:27 AM
  4. Multiple IIF functions possible?
    By Northgate in forum Access
    Replies: 0
    Last Post: 10-08-2008, 01:11 PM
  5. Functions in Query Criteria
    By hraup in forum Queries
    Replies: 1
    Last Post: 10-06-2006, 06:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums