I have limited knowledge on programming Access. I have the following code that populates an access report (rptAllocation) for each client that I select in a list, this works fine:
Code:
Private Sub cmdAllocationMonthlyReview_Click()
Dim i, s As Integer
Dim strfilter As String
For i = 0 To Me.List135.ListCount
If Me.List135.Selected(i) = True Then
s = s + 1
If s = 1 Then strfilter = "Client = '" & Me.List135.Column(1, i) & "'"
If s > 1 Then
strfilter = strfilter & " or " & "Client = '" & Me.List135.Column(1, i) & "'"
End If
End If
Next
If s = 0 Then Exit Sub
If Len(strfilter) > 255 Then
MsgBox "You must select fewer clients. Try selecting 5 to 10 at a time."
Exit Sub
End If
DoCmd.OpenReport "rptAllocation", acViewPreview, "qryAllocation", strfilter
End Sub
I want to modify this code to requery a separate list box, List6, based on the client I have selected in List135. I'm assuming I need to change:
Code:
DoCmd.OpenReport "rptAllocation", acViewPreview, "qryAllocation", strfilter
to perform the requery but I don't know how to reference List6 and include the "strfilter". Any ideas?