Open filtered report

  • Thread starter Thread starter Joel
  • Start date Start date
J

Joel

TIA:

Access 2007. I have a 'summary' report grouped by [request date], no
detailed section. The field in the report design for the group is [request
date by day]. I'm trying to be able to double click on a group date in the
report and open another report with detailed info based on the group date
double clicked on in the summary report.

I tried on dbl click:
dim rd as date
rd=me.[request date by day] 'set date value = group date
docmd.openreport "detail", acPreview, "[request date by day]=" & rd

the "detail" report open but not by group date...i see all date groups.

Any help is much appreciated, THANKS,

Joel
 
Joel,

I tried on dbl click:
dim rd as date
rd=me.[request date by day] 'set date value = group date
docmd.openreport "detail", acPreview, "[request date by day]=" & rd

the "detail" report open but not by group date...i see all date groups.



in you OpenReport "command" you are using the Filter Name field. I've tried
to use this field and could not get it to work. I posted a similar question
to your and was told to use the "Where" parameter instead of the Filter
parameter.

I don't know the specifics but I can get the Where parameter to work, but
could not get the Filter parm to work. Maybe some one in the know can
explain.

DoCmd.OpenReport(ReportName, View, FilterName, WhereCondition, ViewMode,
OpenArgs).

The where condition is a valid SQL Where clause without the work "WHERE".


Good luck.


Dennis
 
Thanks Dennis:

I understand, actually, I ment
docmd.openreport "detail", acPreview, , "[request date by day]=" & rd
I did mean to define a where clause...the clause i have doesn't work.
that's the problem.
 
Dim strWhere As String
If IsDate(me.[request date by day]) Then
strWhere = "[request date by day] = #" & Format(Me.[request date by
day], "yyyy\/mm\/dd") & "#"
End If
docmd.openreport "detail", acPreview, , strWhere


--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Joel said:
Thanks Dennis:

I understand, actually, I ment
docmd.openreport "detail", acPreview, , "[request date by day]=" & rd
I did mean to define a where clause...the clause i have doesn't work.
that's the problem.

Dennis said:
Joel,

I tried on dbl click:
dim rd as date
rd=me.[request date by day] 'set date value = group date
docmd.openreport "detail", acPreview, "[request date by day]=" & rd

the "detail" report open but not by group date...i see all date groups.



in you OpenReport "command" you are using the Filter Name field. I've
tried
to use this field and could not get it to work. I posted a similar
question
to your and was told to use the "Where" parameter instead of the Filter
parameter.

I don't know the specifics but I can get the Where parameter to work, but
could not get the Filter parm to work. Maybe some one in the know can
explain.

DoCmd.OpenReport(ReportName, View, FilterName, WhereCondition, ViewMode,
OpenArgs).

The where condition is a valid SQL Where clause without the work "WHERE".


Good luck.


Dennis
 
Hello Allen:

thanks so much, unfortunately, the report opens with all records

Joel

Allen Browne said:
Dim strWhere As String
If IsDate(me.[request date by day]) Then
strWhere = "[request date by day] = #" & Format(Me.[request date by
day], "yyyy\/mm\/dd") & "#"
End If
docmd.openreport "detail", acPreview, , strWhere


--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Joel said:
Thanks Dennis:

I understand, actually, I ment
docmd.openreport "detail", acPreview, , "[request date by day]=" & rd
I did mean to define a where clause...the clause i have doesn't work.
that's the problem.

Dennis said:
Joel,

I tried on dbl click:
dim rd as date
rd=me.[request date by day] 'set date value = group date
docmd.openreport "detail", acPreview, "[request date by day]=" & rd

the "detail" report open but not by group date...i see all date groups.



in you OpenReport "command" you are using the Filter Name field. I've
tried
to use this field and could not get it to work. I posted a similar
question
to your and was told to use the "Where" parameter instead of the Filter
parameter.

I don't know the specifics but I can get the Where parameter to work, but
could not get the Filter parm to work. Maybe some one in the know can
explain.

DoCmd.OpenReport(ReportName, View, FilterName, WhereCondition, ViewMode,
OpenArgs).

The where condition is a valid SQL Where clause without the work "WHERE".


Good luck.


Dennis
.
 
Hello Allen:

I've been messing with this and believe its a format issue...here's more
detail
[request date by day] is =Format$([Request Date],"Long Date",0,0) this was
created by report wizard for group in report

[request date] is date and time format such as 3/22/2010 3:00:00 pm

Any other ideas?

Thanks,

Joel

Joel said:
Hello Allen:

thanks so much, unfortunately, the report opens with all records

Joel

Allen Browne said:
Dim strWhere As String
If IsDate(me.[request date by day]) Then
strWhere = "[request date by day] = #" & Format(Me.[request date by
day], "yyyy\/mm\/dd") & "#"
End If
docmd.openreport "detail", acPreview, , strWhere


--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Joel said:
Thanks Dennis:

I understand, actually, I ment
docmd.openreport "detail", acPreview, , "[request date by day]=" & rd
I did mean to define a where clause...the clause i have doesn't work.
that's the problem.

:

Joel,

I tried on dbl click:
dim rd as date
rd=me.[request date by day] 'set date value = group date
docmd.openreport "detail", acPreview, "[request date by day]=" & rd

the "detail" report open but not by group date...i see all date groups.



in you OpenReport "command" you are using the Filter Name field. I've
tried
to use this field and could not get it to work. I posted a similar
question
to your and was told to use the "Where" parameter instead of the Filter
parameter.

I don't know the specifics but I can get the Where parameter to work, but
could not get the Filter parm to work. Maybe some one in the know can
explain.

DoCmd.OpenReport(ReportName, View, FilterName, WhereCondition, ViewMode,
OpenArgs).

The where condition is a valid SQL Where clause without the work "WHERE".


Good luck.


Dennis
.
 
Allen:

interesting...

if I use
docmd.openreport "detail", acPreview, , [request date]=#3/22/2010 3:00:00 pm#"
works fine and opens with specific date
if I try
docmd.openreport "detail", acPreview, , [request date by day]=#3/22/2010
3:00:00 pm#" I have window asking for value.

???


Joel

Allen Browne said:
Dim strWhere As String
If IsDate(me.[request date by day]) Then
strWhere = "[request date by day] = #" & Format(Me.[request date by
day], "yyyy\/mm\/dd") & "#"
End If
docmd.openreport "detail", acPreview, , strWhere


--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Joel said:
Thanks Dennis:

I understand, actually, I ment
docmd.openreport "detail", acPreview, , "[request date by day]=" & rd
I did mean to define a where clause...the clause i have doesn't work.
that's the problem.

Dennis said:
Joel,

I tried on dbl click:
dim rd as date
rd=me.[request date by day] 'set date value = group date
docmd.openreport "detail", acPreview, "[request date by day]=" & rd

the "detail" report open but not by group date...i see all date groups.



in you OpenReport "command" you are using the Filter Name field. I've
tried
to use this field and could not get it to work. I posted a similar
question
to your and was told to use the "Where" parameter instead of the Filter
parameter.

I don't know the specifics but I can get the Where parameter to work, but
could not get the Filter parm to work. Maybe some one in the know can
explain.

DoCmd.OpenReport(ReportName, View, FilterName, WhereCondition, ViewMode,
OpenArgs).

The where condition is a valid SQL Where clause without the work "WHERE".


Good luck.


Dennis
.
 
That indicates that the report source has a field named [Request Date] and not
a field named [Request date by Day].

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
Allen:

interesting...

if I use
docmd.openreport "detail", acPreview, , [request date]=#3/22/2010 3:00:00 pm#"
works fine and opens with specific date
if I try
docmd.openreport "detail", acPreview, , [request date by day]=#3/22/2010
3:00:00 pm#" I have window asking for value.

???


Joel

Allen Browne said:
Dim strWhere As String
If IsDate(me.[request date by day]) Then
strWhere = "[request date by day] = #" & Format(Me.[request date by
day], "yyyy\/mm\/dd") & "#"
End If
docmd.openreport "detail", acPreview, , strWhere


--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


Joel said:
Thanks Dennis:

I understand, actually, I ment
docmd.openreport "detail", acPreview, , "[request date by day]=" & rd
I did mean to define a where clause...the clause i have doesn't work.
that's the problem.

:

Joel,

I tried on dbl click:
dim rd as date
rd=me.[request date by day] 'set date value = group date
docmd.openreport "detail", acPreview, "[request date by day]=" & rd

the "detail" report open but not by group date...i see all date groups.



in you OpenReport "command" you are using the Filter Name field. I've
tried
to use this field and could not get it to work. I posted a similar
question
to your and was told to use the "Where" parameter instead of the Filter
parameter.

I don't know the specifics but I can get the Where parameter to work, but
could not get the Filter parm to work. Maybe some one in the know can
explain.

DoCmd.OpenReport(ReportName, View, FilterName, WhereCondition, ViewMode,
OpenArgs).

The where condition is a valid SQL Where clause without the work "WHERE".


Good luck.


Dennis
.
 
Back
Top