Socketwrench in Access sample code?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #1

    Socketwrench in Access sample code?

    If anyone has available some sample VBA code for Socketwrench in VBA I'd like very much to see it. Specifically I'm interested in knowing how to make an event property setting if I don't have a control on a form.

    I have put a Socketwrench control on a form, but I only see event properties for OnUpdated, OnEnter, OnExit, OnGotFocus and OnLostFocus. Those aren't even the events that should be there. I should have
    OnAccept
    OnCancel
    OnConnect
    OnDisconnect
    OnError
    OnProgress
    OnRead
    OnTimeout
    OnTimer
    OnWrite

    I added another Socketwrench control just to see if I had obviously done it wrong, but I got the same result. What could be wrong?

    So, I actually have two questions ... why doesn't my control have the right event properties; and how can I establish event properties without a control on a form.

    Jim
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    Not familiar with Socketwrench but I'm guessing that it is an ActiveX Control. These controls typically only expose a few Properties in the Properties Pane, as you've found out, but if you go into the code module for the form and enter the ControlName followed by the Dot operator, or use the left hand dropdown to select the name, the usual Properties will then be available.

    I'm confused by your second question; you cannot establish event properties of a control unless you have the control on the form. It doesn't necessarily have to be visible, but it has to exist!

    Linq ;0)>

    Comment

    • ADezii
      Recognized Expert Expert
      • Apr 2006
      • 8834

      #3
      Originally posted by jimatqsi
      If anyone has available some sample VBA code for Socketwrench in VBA I'd like very much to see it. Specifically I'm interested in knowing how to make an event property setting if I don't have a control on a form.

      I have put a Socketwrench control on a form, but I only see event properties for OnUpdated, OnEnter, OnExit, OnGotFocus and OnLostFocus. Those aren't even the events that should be there. I should have
      OnAccept
      OnCancel
      OnConnect
      OnDisconnect
      OnError
      OnProgress
      OnRead
      OnTimeout
      OnTimer
      OnWrite

      I added another Socketwrench control just to see if I had obviously done it wrong, but I got the same result. What could be wrong?

      So, I actually have two questions ... why doesn't my control have the right event properties; and how can I establish event properties without a control on a form.

      Jim
      In the Code Pane, select the Control in the Drop Down Combo Box in the ULC. The associated Events for the Control will now appear in the other Combo.

      Comment

      • jimatqsi
        Moderator Top Contributor
        • Oct 2006
        • 1293

        #4
        Thanks, I did not know that about ActiveX controls.

        My second question had to do with creating a control in a class, creating a control without having a form to put a control on.

        I tried the Ostrosoft Winsock control and it would let me do that. Unfortunately, it seems to send the data in the wrong format or something because it gets rejected completely by the server even though the same code works with a MSWINSCK control.

        So anyway, if I want to set the event handler in code, do I just code SocketWrenchCtl 1.OnConnect = "[Event Procedure]", like that; or do I put the actual name of the event handler, i.e. "SocketWrenchCt l1t_OnConnect() "?

        I guess I'll go code it to see.

        Thanks very much.

        Jim

        Comment

        • jimatqsi
          Moderator Top Contributor
          • Oct 2006
          • 1293

          #5
          No, no go ... "the setting you entered isn't valid for this property" whether I set it to
          SocketWrenchCtl _OnConnect()
          or to
          [Event Procedure]

          Comment

          • ADezii
            Recognized Expert Expert
            • Apr 2006
            • 8834

            #6
            Originally posted by jimatqsi
            Thanks, I did not know that about ActiveX controls.

            My second question had to do with creating a control in a class, creating a control without having a form to put a control on.

            I tried the Ostrosoft Winsock control and it would let me do that. Unfortunately, it seems to send the data in the wrong format or something because it gets rejected completely by the server even though the same code works with a MSWINSCK control.

            So anyway, if I want to set the event handler in code, do I just code SocketWrenchCtl 1.OnConnect = "[Event Procedure]", like that; or do I put the actual name of the event handler, i.e. "SocketWrenchCt l1t_OnConnect() "?

            I guess I'll go code it to see.

            Thanks very much.

            Jim
            To the best of my knowledge:
            Code:
            SocketWrenchCtl1.OnConnect = "[Event Procedure]"

            Comment

            • FishVal
              Recognized Expert Specialist
              • Jun 2007
              • 2656

              #7
              Hi, Jim.

              I think SocketWrench class could have no OnConnect property at all. Try to declare SocketWrenchCtl _OnConnect() sub, check in Object browser whether it receives any argument.

              Regards,

              Fish

              P.S. In design view you only see events of OLE control itself and those events that object inside control delegates to container. However, those events should be available in VBA window.

              Comment

              Working...