S
Sky Warren
I have a form that allows a user to click a check box next to each record
they want to appear in preview window, afterwards they click a button that
runs my "Labels" report. I would like to be able to send the selected records
output to my other reports like "Mailing List", etc.
Is there a way to change the code that will allow different reports to run
using the same output. Below is the code from my form:
Dim colCheckBox As New Collection
Public Function IsChecked(vID As Variant) As Boolean
Dim lngID As Long
IsChecked = False
On Error GoTo exit1
lngID = colCheckBox(CStr(vID))
If lngID <> 0 Then
IsChecked = True
End If
exit1:
End Function
Private Sub Command13_Click()
Debug.Print "contact = " & Me.ContactID
If IsChecked(Me.ContactID) = False Then
colCheckBox.Add CLng(Me.ContactID), CStr(Me.ContactID)
Else
colCheckBox.Remove (CStr(Me.ContactID))
End If
Me.Check11.Requery
End Sub
Private Function MySelected() As String
Dim i As Integer
For i = 1 To colCheckBox.Count
If MySelected <> "" Then
MySelected = MySelected & ","
End If
MySelected = MySelected & colCheckBox(i)
Next i
End Function
Private Sub Command16_Click()
Dim strWhere As String
strWhere = MySelected
If strWhere <> "" Then
strWhere = "ContactID in (" & strWhere & ")"
End If
DoCmd.OpenReport "Grace's Clients", acViewPreview, , strWhere
End Sub
they want to appear in preview window, afterwards they click a button that
runs my "Labels" report. I would like to be able to send the selected records
output to my other reports like "Mailing List", etc.
Is there a way to change the code that will allow different reports to run
using the same output. Below is the code from my form:
Dim colCheckBox As New Collection
Public Function IsChecked(vID As Variant) As Boolean
Dim lngID As Long
IsChecked = False
On Error GoTo exit1
lngID = colCheckBox(CStr(vID))
If lngID <> 0 Then
IsChecked = True
End If
exit1:
End Function
Private Sub Command13_Click()
Debug.Print "contact = " & Me.ContactID
If IsChecked(Me.ContactID) = False Then
colCheckBox.Add CLng(Me.ContactID), CStr(Me.ContactID)
Else
colCheckBox.Remove (CStr(Me.ContactID))
End If
Me.Check11.Requery
End Sub
Private Function MySelected() As String
Dim i As Integer
For i = 1 To colCheckBox.Count
If MySelected <> "" Then
MySelected = MySelected & ","
End If
MySelected = MySelected & colCheckBox(i)
Next i
End Function
Private Sub Command16_Click()
Dim strWhere As String
strWhere = MySelected
If strWhere <> "" Then
strWhere = "ContactID in (" & strWhere & ")"
End If
DoCmd.OpenReport "Grace's Clients", acViewPreview, , strWhere
End Sub