Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MSComm array?? MSComm.CommEvent

Posted on 2004-08-02
1
Medium Priority
?
856 Views
Last Modified: 2013-12-25
have MSComm array MSComm3(0),MSComm3(1),MSComm3(2).. but i can't get this code to work,,

Compile error:

Procedure declaration does not match description of event or procedure having the same name.

how do i solve this problem. thx..  


Code:

Public Sub MSComm3_OnComm()

    If frmMain.MSComm3.CommEvent <> 2 Then
        Exit Sub
    End If
     

    Select Case MSComm3(0).CommEvent
        Case comEvReceive
                    .........
    End Select
     

    Select Case MSComm3(1).CommEvent
        Case comEvReceive
    ................
    End Select
     

    Select Case MSComm3(2).CommEvent
        Case comEvReceive
    ......................
     End Select


End sub

can i use an array with this control. or must i have a MSComm1_OnComm, MSComm2_OnComm and so on...

thx :)
0
Comment
Question by:NissePPP
1 Comment
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 150 total points
ID: 11692089
You seem to have lost the index paramenter form the event.

It should look like this

Private Sub MSComm1_OnComm(Index As Integer)

End Sub

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question