A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query twice with the same criteria ==



 
 
Thread Tools Display Modes
  #11  
Old December 2nd, 2009, 10:57 PM posted to microsoft.public.access.queries
DeDe
external usenet poster
 
Posts: 55
Default Query twice with the same criteria ==

I will first thank you for your help
Regarding your answer, I will be able to make oly one “MakeTable Query”
But I will explain you why I need a MakeTable queries. I have two table

Table A
CRA N° object_Id application date
1 10
1 11
1 12
2 11
2 21
3 10
3 12
3 32

Table B
CRA N° test_item CRA Status
1 test 100 x
2 test 200 y
3 test 300 z

I will first retrieve all object_Id from one CRA N°  I create a table
containing those objects_Id
When I will make a report containing each objects & for each one all CRA N°
associate
Did you see a other way to do it ?

"John W. Vinson" wrote:

On Tue, 1 Dec 2009 08:05:01 -0800, dede
wrote:

I will run two "make-table" query with the same criteria
I call those two query from a form with
DoCmd.OpenQuery
the criteria in the query is twice "[Entrer No CRA]"
where and how could I save this constant (write in the msgbox) to call it
again in the next query ?

Thanks for any help.


I'd suggest instead putting an unbound textbox on the Form, and use a
criterion referencing it. Instead of a criterion of [Entrer No CRA] use
something like

[Forms]![YourFormName]![YourTextboxName]


One concern: I'd be very very reluctant to use MakeTable queries in any
production database. They bloat the database, clutter it with new tables, and
they are very rarely actually needed; there's not much that you can do with a
Table that cannot also be done with a properly designed Select Query
referencing existing tables. What are these two new tables, and why do you
feel that you need them?
--

John W. Vinson [MVP]


  #12  
Old December 2nd, 2009, 11:50 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query twice with the same criteria ==

On Wed, 2 Dec 2009 14:57:01 -0800, dede
wrote:

I will first thank you for your help
Regarding your answer, I will be able to make oly one MakeTable Query
But I will explain you why I need a MakeTable queries. I have two table

Table A
CRA N object_Id application date
1 10
1 11
1 12
2 11
2 21
3 10
3 12
3 32

Table B
CRA N test_item CRA Status
1 test 100 x
2 test 200 y
3 test 300 z

I will first retrieve all object_Id from one CRA N ? I create a table
containing those objects_Id
When I will make a report containing each objects & for each one all CRA N
associate
Did you see a other way to do it ?


Yes. Create an appropriate Query.

Your MakeTable query already contains all the information that you need, just
as a SELECT QUERY. You do not need to write all that data wastefully to a new
table in order to create a Report; just base the report directly on the query.

I'm not sure I understand your logic though.

--

John W. Vinson [MVP]
  #13  
Old December 3rd, 2009, 08:06 AM posted to microsoft.public.access.queries
DeDe
external usenet poster
 
Posts: 55
Default Query twice with the same criteria ==

I do not really see how
I will have first to ask the user which CRA_N° to retrieve all object_Id
associated
When I will have retrieve for each object_Id all CRA_N° & test_item =

After the first question (example 3)
3 10
3 12
3 32

===== Results
1 10 test 100
3 10 test 300
1 12 test 100
3 12 test 300
3 32 test 300


"John W. Vinson" wrote:

On Wed, 2 Dec 2009 14:57:01 -0800, dede
wrote:

I will first thank you for your help
Regarding your answer, I will be able to make oly one “MakeTable Query”
But I will explain you why I need a MakeTable queries. I have two table

Table A
CRA N° object_Id application date
1 10
1 11
1 12
2 11
2 21
3 10
3 12
3 32

Table B
CRA N° test_item CRA Status
1 test 100 x
2 test 200 y
3 test 300 z

I will first retrieve all object_Id from one CRA N° ? I create a table
containing those objects_Id
When I will make a report containing each objects & for each one all CRA N°
associate
Did you see a other way to do it ?


Yes. Create an appropriate Query.

Your MakeTable query already contains all the information that you need, just
as a SELECT QUERY. You do not need to write all that data wastefully to a new
table in order to create a Report; just base the report directly on the query.

I'm not sure I understand your logic though.

--

John W. Vinson [MVP]
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.