Limiting data in a report

  • Thread starter Thread starter Pops Jackson
  • Start date Start date
P

Pops Jackson

I have a field in my database that contains only single letters which refer
to the specific type of data contained in the other fields. ("A" refers to
one specific type while "B" refers to another, etc.) I am attempting to set
up an input box which will allow the user to produce a report consisting of
data related to "A", "B" or whichever type is desired.

Private Sub Report_Open(Cancel As Integer)
x = InputBox("C for Airmail, R for Revenues, O for Official Stamps. Leave
blank for all")
Reports![Wish List]![Prefix]![Criteria] = x
End Sub

I seem to remember doing this once before with a related statement in the
Criteria cell for the particular field but cannot find my records. If I have
totally confused you I will re-state the problem, hoping to be more clear.

Thanks for any help you can give,
 
Hi Pops Jackson,

try in this way

Private Sub Report_Open(Cancel As Integer)
x = InputBox("C for Airmail, R for Revenues, O for Official Stamps. Leave
blank for all")
Me.Filter = "replace with the name of the field on which apply the filter='"
& x & "'"
Me.FilterOn = True
End Sub

HTH Paolo
 
Thanks, Paolo. That did the trick.
--
Pops Jackson


Paolo said:
Hi Pops Jackson,

try in this way

Private Sub Report_Open(Cancel As Integer)
x = InputBox("C for Airmail, R for Revenues, O for Official Stamps. Leave
blank for all")
Me.Filter = "replace with the name of the field on which apply the filter='"
& x & "'"
Me.FilterOn = True
End Sub

HTH Paolo

Pops Jackson said:
I have a field in my database that contains only single letters which refer
to the specific type of data contained in the other fields. ("A" refers to
one specific type while "B" refers to another, etc.) I am attempting to set
up an input box which will allow the user to produce a report consisting of
data related to "A", "B" or whichever type is desired.

Private Sub Report_Open(Cancel As Integer)
x = InputBox("C for Airmail, R for Revenues, O for Official Stamps. Leave
blank for all")
Reports![Wish List]![Prefix]![Criteria] = x
End Sub

I seem to remember doing this once before with a related statement in the
Criteria cell for the particular field but cannot find my records. If I have
totally confused you I will re-state the problem, hoping to be more clear.

Thanks for any help you can give,
 
Back
Top