reprot/query problem

  • Thread starter Thread starter newuser
  • Start date Start date
N

newuser

How do i go about adding a parameter query to a report deisgned to make
labels so that i get certain criteria in the report?? have tried record
source haven't had much luck with it.
Thanks
 
Not quit sure what your question is... If you want to set a criteria in a
report try opening the Record Source of the report and then under criteria of
the Query set whatever criteria suits your needs...

Hope I was close to what u were asking for...
Adnan
 
When using reports, I find it much easier to have no filtering in the query.
The use the Where argument of the OpenReport method to do the filtering. If
you pass an empty string, then no filtering will apply. That is useful when
the user is allowed to select criteria but does not. In the example below,
we want to filter the report for records that fall between two dates. The
query field would be [IncidentDate].

strWhere = "[IncidentDate] BETWEEN #" & Me.StartDate & "# AND #" &
Me.EndDate & "#"

Docmd.OpenReport "MyReport", , , strWhere
 
hi
cheers for replying back,but am not quite sure what you mean,where can i
find the option for the "where argument"?

Klatuu said:
When using reports, I find it much easier to have no filtering in the query.
The use the Where argument of the OpenReport method to do the filtering. If
you pass an empty string, then no filtering will apply. That is useful when
the user is allowed to select criteria but does not. In the example below,
we want to filter the report for records that fall between two dates. The
query field would be [IncidentDate].

strWhere = "[IncidentDate] BETWEEN #" & Me.StartDate & "# AND #" &
Me.EndDate & "#"

Docmd.OpenReport "MyReport", , , strWhere
--
Dave Hargis, Microsoft Access MVP


newuser said:
How do i go about adding a parameter query to a report deisgned to make
labels so that i get certain criteria in the report?? have tried record
source haven't had much luck with it.
Thanks
 
With your report opened on design view, navigate to Code under View menu and
paste Klatuu’s code.

--
HTP
Adnan

If I have helped and/or answered your question, please let me know by
replying or clicking question answered (below positioned ‘Yes’ button).


newuser said:
hi
cheers for replying back,but am not quite sure what you mean,where can i
find the option for the "where argument"?

Klatuu said:
When using reports, I find it much easier to have no filtering in the query.
The use the Where argument of the OpenReport method to do the filtering. If
you pass an empty string, then no filtering will apply. That is useful when
the user is allowed to select criteria but does not. In the example below,
we want to filter the report for records that fall between two dates. The
query field would be [IncidentDate].

strWhere = "[IncidentDate] BETWEEN #" & Me.StartDate & "# AND #" &
Me.EndDate & "#"

Docmd.OpenReport "MyReport", , , strWhere
--
Dave Hargis, Microsoft Access MVP


newuser said:
How do i go about adding a parameter query to a report deisgned to make
labels so that i get certain criteria in the report?? have tried record
source haven't had much luck with it.
Thanks
 
Back
Top