Maquee text on form using ActiveX Control (WebBrowser)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Stoic
    New Member
    • Jun 2012
    • 68

    Maquee text on form using ActiveX Control (WebBrowser)

    Hi,
    I have a form and I have place an ActiveX Control(WebBrow ser) that will populate a web page with strolling texts, I have developed in html.
    In the form 'On Current Event' I have placed a code that depend on a table called 'strol' that also holds the path to the html file. Normally, this should work but I am not sure why it is not. Can anyone help? This is what I have in the event procedure: I


    Code:
    If Len([strol]) > 0 Then
            WebBrowser3.Navigate URL:=[strol]
        Else
            WebBrowser3.Navigate URL:="C:\Users\M&E\Documents\Organizations\LTTP\Database\WelcomeStatement.htm"
        End If
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3653

    #2
    Stoic,

    Is strol the table name or the name of a field in a table? Your code may be a bit confusing. Just to clear it up a bit, I would have code similar to the following:

    Code:
    Dim strLink as String
    strLink = [use code to find the string you want to look up in a table, etc.]
    If LenstrLink) > 0 Then 
        WebBrowser3.Navigate URL:=strLink 
    Else 
        WebBrowser3.Navigate URL:="C:\Users\M&E\Documents\Organizations\LTTP\Database\WelcomeStatement.htm" 
    End If
    I've tried with some sample values in strLink and this seems to work just fine. Let me know if this helps.

    Comment

    • Stoic
      New Member
      • Jun 2012
      • 68

      #3
      Thanks twinnyfo, it did work. I don't understand why my code is not working. I have used it before. Anyway, maybe I am missing out on some lines. You are grate man. Thanks

      Comment

      • Stoic
        New Member
        • Jun 2012
        • 68

        #4
        oh! sorry, yes strol is the table as well as the field name.

        Comment

        • Rabbit
          Recognized Expert MVP
          • Jan 2007
          • 12517

          #5
          You should avoid giving two things the same name. It can cause ambiguities that can mess with code.

          Comment

          Working...