Hello,

I am linking two querries together, and when I do this, I get a line for every instance the link shows up in each of the querries. I want to limit what is displayed based on certain parameters. I know how I would program this type of functionality using arrays in Fortran or Matlab, but do not know how to do it with access. I have attached some code I have tried. Is it possible to use array's in access? How can you index or control the order of the dat in querry that is used as input?

Thanks!!!

Jeff


Below is the function (not fully debugged) that I have put together so far.
The biggest problem with it is there does not seem to be a specif order the data accesses the function.

Public Function ShowRow(strWorkOrder As String, strPartNum As String, intWOQty As Integer, intNeedQty As Integer) As Integer
If (strPartNum <> strLastNumber) Then
intExtraQty = intWOQty - intNeedQty
If (intExtraQty > 0) Then
intNext = 0
Else
intNext = 1
End If
intNextWO = 0
strFirstWO = strWorkOrder
strCurrentWO = strWorkOrder
strLastNumber = strPartNum
ShowRow = 1
Else
If (intNext = 0) Then
If (strFirstWO = strWorkOrder) Then 'checks to see if moved to next sales order
ShowRow = 0
If (strCurrentWO = strWorkOrder) Then 'checks to see if up to current WO
intExtraQty = intExtraQty - intNeedQty
intNext = ChgIntNext(intExtraQty)
End If
End If
Else
If (intNext = 1) Then
ShowRow = 1
intExtraQty = intExtraQty + intWOQty
intNext = ChgIntNext(intExtraQty)
Else
ShowRow = 0
End If
End If
End If


End Function


Public Function ChgIntNext(intExtraQty As Integer) As Integer
If (intExtraQty < 0) Then
ChgIntNext = 1
Else
ChgIntNext = 0
End If
End Function




Public Sub GlblInitialize()
intNext = 0
intNextWO = 0
strLastNumber = " "
strFirstWO = " "
strCurrentWO = " "
intExtraQty = 0
intCounter = 0
End Sub