Limiting data in a report

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,
 
P

Paolo

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
 
P

Pops Jackson

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top