newbie: array to function getting type mis-match 
Author Message
 newbie: array to function getting type mis-match

Hello I am Passing an Array to a function and I am getting a type mis-match ... Help

code

  Dim ObjAcc, ObjDBE, ObjDB, rs, Column, Row, Body1
  Set objAcc = WScript.CreateObject("Access.Application")
  Set objDBE = objAcc.DBEngine
  Set objDB = objdbe.OpenDatabase("h:\inetpub\wwwroot\kbhd\db2.mdb")
  Set rs = objDB.OpenRecordset("jobs")

  'count jobs per tech
    jim1 = 0
    kay = 0
    tam = 0
    paul = 0
    mar = 0

   rs.movefirst
         Do until rs.eof
            tech1 = rs.Fields("tech").Value
           status = rs.Fields("status").Value
            If status = "open" Then

              If tech1 = "jim" Then
                   jim1 = jim1 + 1
                   msgbox(jim1)
              End If

               If tech1 = "kay" Then
                   kay1 = kay1 + 1
              End If

              If tech1 = "tam" Then
                   tam1 = tam1 + 1
              End If

               If tech1 = "paul" Then
                   paul1 = paul1 + 1
              End If

            End If
     rs.movenext
  Loop  

'############################################
' add results to DB
'############################################
  dim techs(5)
    techs(0) = jim1
    techs(1) = tam
    techs(2) = kay
    techs(3) = paul
 '   techs(4) = mar
'
low_one(techs)  

Function low_one(techs)

  i = 0

     check1 = tech(i)

end Function

thanks in advance



Sun, 18 Sep 2005 03:02:41 GMT  
 newbie: array to function getting type mis-match

Quote:

> Hello I am Passing an Array to a function and I am getting a type mis-match
> ... Help

[snip]

Quote:
> Function low_one(techs)

                   ^^^^^
Quote:
>   i = 0

>      check1 = tech(i)

                ^^^^

Quote:
> end Function

You're missing an 's'.

--
Steve

Most people work just hard enough not to get fired and get paid just enough
money not to quit. -George Carlin



Sun, 18 Sep 2005 03:16:37 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. function getting type mismatch

2. Passing an array to a sub or function I get type mismatch

3. Type Mismatch - Array of Type Long

4. Type mismatch on array

5. type mismatch when modifying an array

6. Type Mismatch for Array

7. Type mismatch transferrring recordset to array?

8. Type mismatch in a private array defined in a class

9. Type Mismatch on my array elements.

10. Arrays dim'd at class scope get type mismatch

11. Type Mismatch returning variant array from COM object

12. Type mismatch when returning a variant array

 

 
Powered by phpBB® Forum Software