I'm sorry, I can't find the code for the individual filter.
When I filter, I am in the form screen, right click on a field, select filter by selection. In the specific case that I am performing right now it finds 3 of 5 records. I would like then to have a button that would pull up a report that would only show those 3 records. Currently the button I have loaded with the code above creates a report with only the one record that is currently showing on the screen. The filter will not be a consant field or a constant value. The end user needs to be able to filter based on any random field for any random value.
Here is all the code I have for the form:
Private Sub Command22_Click()
Dim stDocName As String
On Error GoTo Err_Command47_Click
DoCmd.RunCommand acCmdSaveRecord
stDocName = "test"
DoCmd.OpenReport stDocName, acViewPreview, , "[CommentID] = " & Me![CommentID]
Exit_Command47_Click:
Exit Sub
Err_Command47_Click:
MsgBox Err.Description
Resume Exit_Command47_Click
End Sub
Private Sub Command26_Click()
On Error GoTo Err_Command26_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 0, 2, acMenuVer70
Exit_Command26_Click:
Exit Sub
Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click
End Sub
Private Sub Command27_Click()
On Error GoTo Err_Command27_Click
DoCmd.Close
Exit_Command27_Click:
Exit Sub
Err_Command27_Click:
MsgBox Err.Description
Resume Exit_Command27_Click
End Sub
Private Sub Command28_Click()
On Error GoTo Err_Command28_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70
Exit_Command28_Click:
Exit Sub
Err_Command28_Click:
MsgBox Err.Description
Resume Exit_Command28_Click
End Sub
Private Sub Combo29_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[CommentID] = " & Str(Nz(Me![Combo29], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Private Sub Command33_Click()
On Error GoTo Err_Command33_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70
Exit_Command33_Click:
Exit Sub
Err_Command33_Click:
MsgBox Err.Description
Resume Exit_Command33_Click
End Sub
thanks!