G
Gord D via AccessMonster.com
Hi I have an array, created by a recordset, and I want to pass it to a
function along with the value. the function will check if the value is in
the array and return YES / NO
I'm getting a comile error of TypeMismatch: Array
I have a feeling the array that is created by the Getrecords is my problem
as I don't now what type it is.
Private Sub main()
Dim rs As New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "select ID from tAccounts", CurrentProject.Connection,
adOpenDynamic, adLockOptimistic
iPos = rs.RecordCount
rs.MoveFirst
aIFIS = rs.GetRows(iPos)
rs.Close
testval = "123456"
retval = ValidAccount aIFIS, testval
msgbox retval
End Sub
Private Function ValidAccount(aIFISx() As String, sValx As String)
Dim sValx As String, i As Integer
MsgBox aIFISx(i)
For i = LBound(aIFISx) To UBound(aIFISx)
If sValx = aIFISx(i) Then
sValx = "VALID"
Exit For
Else
sValx= "NOTVALID"
End If
Next i
End Function
function along with the value. the function will check if the value is in
the array and return YES / NO
I'm getting a comile error of TypeMismatch: Array
I have a feeling the array that is created by the Getrecords is my problem
as I don't now what type it is.
Private Sub main()
Dim rs As New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "select ID from tAccounts", CurrentProject.Connection,
adOpenDynamic, adLockOptimistic
iPos = rs.RecordCount
rs.MoveFirst
aIFIS = rs.GetRows(iPos)
rs.Close
testval = "123456"
retval = ValidAccount aIFIS, testval
msgbox retval
End Sub
Private Function ValidAccount(aIFISx() As String, sValx As String)
Dim sValx As String, i As Integer
MsgBox aIFISx(i)
For i = LBound(aIFISx) To UBound(aIFISx)
If sValx = aIFISx(i) Then
sValx = "VALID"
Exit For
Else
sValx= "NOTVALID"
End If
Next i
End Function