Print All Filtered Records + Search capability

  • Thread starter Thread starter chuaby
  • Start date Start date
C

chuaby

Hi

Print All Filtered Record
===========================
i have a button to print only the record i am previewing.

i wrote :

DoCmd.OpenReport stDocName, acViewPreview, , "ID = " &
"Forms![Frm_Archive_Inventory]![Txt_RecID]"


But, i would like to "Print All" that i have filtered. May i know how
can i go about it ?

removing the filter parameter "ID = " &
"Forms![Frm_Archive_Inventory]![Txt_RecID]" in the OpenReport will
really print all records in the database and not those that i have
filterd in the form.


Search Capability
===========================
I am thinking of creating a form with 5 input fieldS that correspond
to the 5
searchable fields. May i know how can i create a "function" that will
display on the form all the records that meet anyone or all of the 5
search criteria that a user has key in ?

Thank you in advance
Boon Yiang
 
This example shows how to print the filterered records if the form is
filtered, else print just the one record in the form:

Dim strWhere As String

If Me.FilterOn Then
strWhere = Me.Filter
Else
strWhere = "[ID] = " & Me.[txt_RecID]
End If

DoCmd.OpenReport stDocName, acViewPreview, , strWhere
 
Back
Top