Results 1 to 4 of 4

Thread: Run time error 5

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    2

    Run time error 5

    Hello,

    i've made a program in visual basic using the mscomm.

    The program works good on Windows 2000 And Windows XP(sp1)
    But when I try it on Win xp Sp2 then the program does'nt work.

    The problem is this code:
    binnen = AscB(MSComm1.Input)

    I can't use AscB in winxp sp2
    VB Code:
    1. Private Sub Form_Load()
    2.  
    3.    With MSComm1
    4.       .CommPort = 1
    5.       .Handshaking = comNone
    6.       .Settings = "9600,n,8,1"
    7.       .PortOpen = True
    8.    End With
    9.    
    10.  
    11. End Sub
    12.  
    13. Private Sub MSComm1_OnComm()
    14. binnen = AscB(MSComm1.Input)
    15.  
    16. If binnen = 40 Then
    17. display40.Visible = True
    18. display41.Visible = False
    19. display42.Visible = False
    20. display43.Visible = False
    21. display44.Visible = False
    22. display45.Visible = False
    23. display46.Visible = False
    24. display47.Visible = False
    25. display48.Visible = False
    26. display49.Visible = False
    27. End If
    28.  
    29. If binnen = 41 Then
    30. display40.Visible = False
    31. display41.Visible = True
    32. End If
    33.  
    34. If binnen = 42 Then
    35. display41.Visible = False
    36. display42.Visible = True
    37. End If
    38.  
    39. If binnen = 43 Then
    40. display42.Visible = False
    41. display43.Visible = True
    42. End If
    43.  
    44. If binnen = 44 Then
    45. display43.Visible = False
    46. display44.Visible = True
    47.  
    48. End If
    49.  
    50. If binnen = 45 Then
    51. display44.Visible = False
    52. display45.Visible = True
    53. End If

    Maby someone know how to fix this problem, or know how to convert a string to byte so that I don't have to use The ASC function ?

    Thnx for any help

    Ronald
    Last edited by si_the_geek; Jan 16th, 2007 at 01:12 PM. Reason: corrected tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width