473,324 Members | 1,646 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,324 software developers and data experts.

Same query with filter

I want to use one query but apply it to 4 different forms. So if Category
field = 1 then only display items with Category =1 on form1, if Category =
2, all items with category = 2 display on form 2. Is this possible ? If so
how.

Many thanks
Jan 23 '07 #1
4 1377
Smiley wrote:
>I want to use one query but apply it to 4 different forms. So if Category
field = 1 then only display items with Category =1 on form1, if Category =
2, all items with category = 2 display on form 2. Is this possible ? If so
how.

One or two newsgroups would have been sufficient, no need to
crosspost to so many groups.

The best way to do that is to create a master form to open
your form. The code behind a command button to open your
form with a specific category could be something like:

DoCmd.OpenForm "name of the form", , , "Category=1"

Alternatively, you could have a text or combo box on the
master form where users can enter or select the category.
Then the query can use a criteria of this type:
=Forms![name of master form].[name of text box]

--
Marsh
MVP [MS Access]
Jan 23 '07 #2
Thanks Marshall

"Marshall Barton" <ma*********@wowway.comwrote in message
news:75********************************@4ax.com...
Smiley wrote:
>>I want to use one query but apply it to 4 different forms. So if Category
field = 1 then only display items with Category =1 on form1, if Category =
2, all items with category = 2 display on form 2. Is this possible ? If so
how.


One or two newsgroups would have been sufficient, no need to
crosspost to so many groups.

The best way to do that is to create a master form to open
your form. The code behind a command button to open your
form with a specific category could be something like:

DoCmd.OpenForm "name of the form", , , "Category=1"

Alternatively, you could have a text or combo box on the
master form where users can enter or select the category.
Then the query can use a criteria of this type:
=Forms![name of master form].[name of text box]

--
Marsh
MVP [MS Access]

Jan 25 '07 #3
On Jan 23, 3:40 pm, Marshall Barton <marshbar...@wowway.comwrote:
The best way to do that is to create a master form to open
your form. The code behind a command button to open your
form with a specific category could be something like:

DoCmd.OpenForm "name of the form", , , "Category=1"
Why is that the best way?

Jan 25 '07 #4
Lyle Fairfield wrote:
>On Jan 23, 3:40 pm, Marshall Barton <marshbar...@wowway.comwrote:
>The best way to do that is to create a master form to open
your form. The code behind a command button to open your
form with a specific category could be something like:

DoCmd.OpenForm "name of the form", , , "Category=1"

Why is that the best way?

I was thinking that user interactions with the query
selection process would be cumbersome if a form was not
involved.

--
Marsh
Jan 25 '07 #5

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

Similar topics

6
by: Pedro Alves | last post by:
Hi I'm having serious problems with a mission critical app that runs on postgres (and has been running for the past 3 years). It's rather large, and lately things are not going well. The...
8
by: Együd Csaba | last post by:
Hi All, how can I improve the query performance in the following situation: I have a big (4.5+ million rows) table. One query takes approx. 9 sec to finish resulting ~10000 rows. But if I run...
3
by: Richard | last post by:
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...
5
by: Rated R1 | last post by:
I wrote this before in the NGs, so I am going to paste the responses that I got and see if someone can please help me. Email me and we can set something up as Id even be willing to pay for your...
5
by: jjyconsulting | last post by:
Newbie needing some help. I have a tblParticipants. The fields include gender, education_level, income, occupation etc., I'm trying to create a form where a user can run a query from the form and...
4
by: Simon | last post by:
Dear reader, The syntax for Docmd.OpenReport is: OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode, OpenArgs) Example The following example prints Sales Report while...
1
by: TF | last post by:
This group came through for me last time so here we go again. My page shows paint colors, brand name, product code, etc in a gridview with the background matching the paint color. Several links on...
1
by: jesmi | last post by:
my code is: U]employee.cfm <html> <head> <title>Employee List</title> </head> <body> <h1>Employee List</h1>
0
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I am running Access 2007. I have a report that I want to filter. I can go into Advanced...Advanced Filter/Sort... and setup a filter that works fine on the report when I apply it. When in this...
0
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ | last post by:
I am running Access 2007. I have a report that I want to filter. I can go into Advanced...Advanced Filter/Sort... and setup a filter that works fine on the report when I apply it. When in this...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.