473,386 Members | 1,602 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Filter a report based on same filter on a form

Hi,

I have a form based on a table. When I filter the form I want to run a
report based on the same table with the same filter as the form. No problem
until I want to filter a combo box where the text value is on a different
table. The me.filter is then a text instead of the id-number from the lookup
table. This causes the report to prompt for the parameter.

How do I get by this problem? Do I need to create a temporary table? I
rather not. or is there another solution without using filter?
Appreciate any help
Richard
Nov 12 '05 #1
3 6583
Sounds like the combo's bound column is zero width?

You should still be able to use the value from the invisible column in the
WhereCondition for your OpenReport. Just use the Value of the combo.

It is also possible to use its Column() property if necessary. (That's
zero-based.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Richard" <rw**********@chello.se> wrote in message
news:dMQpb.883$%W3.1336@amstwist00...

I have a form based on a table. When I filter the form I want to run a
report based on the same table with the same filter as the form. No problem until I want to filter a combo box where the text value is on a different
table. The me.filter is then a text instead of the id-number from the lookup table. This causes the report to prompt for the parameter.

How do I get by this problem? Do I need to create a temporary table? I
rather not. or is there another solution without using filter?

Nov 12 '05 #2
Yes, that is true. But what I want to do is to use the filter the user sets
in the form, to the report.
For instance. If the user only wants to list clients from the State CA he
filters the form and the property me.filter sets to ((tblClients.State =
"CA")). That filter is then used to the report. Everything is working fine
until the user filters that combo. The values are taken from a lookup table
and the me.filter is set to: ((lookup_cboRemarks.remark = "Valid member")).
The lookup table is called tlkpRemarks and when I try to run the report it
asks for the parameter value of lookup_cboRemarks.remark.

The combo's bound column is zero width like you predicted and the second
column is all the remarks. I don't really want to alter the filter but if I
need to it gets messy because the filter string can get long and
complicated.

I am using Access 2002.
Appreciate any further help
Richard Wernerhjelm
"Allen Browne" <al*********@SeeSig.invalid> skrev i meddelandet
news:3f**********************@freenews.iinet.net.a u...
Sounds like the combo's bound column is zero width?

You should still be able to use the value from the invisible column in the
WhereCondition for your OpenReport. Just use the Value of the combo.

It is also possible to use its Column() property if necessary. (That's
zero-based.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Richard" <rw**********@chello.se> wrote in message
news:dMQpb.883$%W3.1336@amstwist00...

I have a form based on a table. When I filter the form I want to run a
report based on the same table with the same filter as the form. No

problem
until I want to filter a combo box where the text value is on a different table. The me.filter is then a text instead of the id-number from the

lookup
table. This causes the report to prompt for the parameter.

How do I get by this problem? Do I need to create a temporary table? I
rather not. or is there another solution without using filter?


Nov 12 '05 #3
So your request is that the report can interpret a filter containing:
lookup_cboRemarks.remark = "some text"

I'm not sure how the filter is being set: filter by form perhaps? Would it
be practical to include the combo's lookup table in the RecordSource of the
form (using an outer join query), so the filter could become:
SomeTable.remark = "some text"
The report would then be able to filter that correctly (assuming it is also
based on a query that contains the lookup table).

If that can't be done, it may be easier to change the way the filter string
is being generated so that it contains the value from the bound column. The
report would interpret that correctly. Typically I include unbound boxes in
the form header for the fields that user is likely to need to filter on, and
build the filter string programmatically. This has the advantage that it
works with mde files and runtimes where the filter-by-form is not available.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Richard" <rw**********@chello.se> wrote in message
news:ec3qb.988$%W3.1576@amstwist00...
Yes, that is true. But what I want to do is to use the filter the user sets in the form, to the report.
For instance. If the user only wants to list clients from the State CA he
filters the form and the property me.filter sets to ((tblClients.State =
"CA")). That filter is then used to the report. Everything is working fine
until the user filters that combo. The values are taken from a lookup table and the me.filter is set to: ((lookup_cboRemarks.remark = "Valid member")). The lookup table is called tlkpRemarks and when I try to run the report it
asks for the parameter value of lookup_cboRemarks.remark.

The combo's bound column is zero width like you predicted and the second
column is all the remarks. I don't really want to alter the filter but if I need to it gets messy because the filter string can get long and
complicated.

I am using Access 2002.
Appreciate any further help
Richard Wernerhjelm
"Allen Browne" <al*********@SeeSig.invalid> skrev i meddelandet
news:3f**********************@freenews.iinet.net.a u...
Sounds like the combo's bound column is zero width?

You should still be able to use the value from the invisible column in the
WhereCondition for your OpenReport. Just use the Value of the combo.

It is also possible to use its Column() property if necessary. (That's
zero-based.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Richard" <rw**********@chello.se> wrote in message
news:dMQpb.883$%W3.1336@amstwist00...

I have a form based on a table. When I filter the form I want to run a
report based on the same table with the same filter as the form. No

problem
until I want to filter a combo box where the text value is on a

different table. The me.filter is then a text instead of the id-number from the

lookup
table. This causes the report to prompt for the parameter.

How do I get by this problem? Do I need to create a temporary table? I
rather not. or is there another solution without using filter?

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
4
by: Nhmiller | last post by:
This is directly from Access' Help: "About designing a query When you open a query in Design view, or open a form, report, or datasheet and show the Advanced Filter/Sort window (Advanced...
1
by: lorirobn | last post by:
Hi, I have a report that works just fine. Now I would like to add the capability to choose selection criteria to limit what is displayed. I created several reports that do this, but they used...
1
by: mpmason14 | last post by:
how can i create the title for my report based on the filtered criteria in a form? the form opens the report and i want the report to have the title of what was filtered. the user can filter among...
0
by: Josetta | last post by:
This is for informational purposes...I had a problem and I thought it might help others in a similar situation. I hope someone, someday, finds this idea useful. I've garnered so much knowledge...
3
by: emgallagher | last post by:
I have a form which lists studies. People can filter the form based on details about the study, such as the study type. Currently users filter via the right click method. I would like to be...
5
by: Whasigga | last post by:
Hi guys I've got a report that I have created. It is based off of a query that I made. I use it to show different combinations of data, but its the same type of information... It is called...
5
by: DAHMB | last post by:
Hi all, Using Access 2007 I have a report called Sunday School Attendance based on a Query called qryAttendance the query is as follows: SELECT tblSundaySchoolAttendance.StudentID,...
3
by: franc sutherland | last post by:
Hello, I have a report which I filter using the me.filter command in the OnOpen event. Me.Filter = "OrderID=" & Forms!variable_form_name! Me.FilterOn = True I want to be able to open that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.