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
  #1  
Old December 1st, 2009, 05:05 PM posted to microsoft.public.access.queries
DeDe
external usenet poster
 
Posts: 55
Default Query twice with the same criteria ==

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.

  #2  
Old December 1st, 2009, 05:58 PM posted to microsoft.public.access.queries
vanderghast
external usenet poster
 
Posts: 593
Default Query twice with the same criteria ==

Make the criteria in the form of FORMS!formNameHere!controlNameHere

as long as the said form is open (can be invisible, if you wish).

Fill the control with the wanted value, then run the two DoCmd commands.


Vanderghast, Access MVP


"dede" wrote in message
...
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.


  #3  
Old December 1st, 2009, 05:58 PM posted to microsoft.public.access.queries
vanderghast
external usenet poster
 
Posts: 593
Default Query twice with the same criteria ==

Make the criteria in the form of FORMS!formNameHere!controlNameHere

as long as the said form is open (can be invisible, if you wish).

Fill the control with the wanted value, then run the two DoCmd commands.


Vanderghast, Access MVP


"dede" wrote in message
...
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.


  #4  
Old December 1st, 2009, 05:58 PM posted to microsoft.public.access.queries
vanderghast
external usenet poster
 
Posts: 593
Default Query twice with the same criteria ==

Make the criteria in the form of FORMS!formNameHere!controlNameHere

as long as the said form is open (can be invisible, if you wish).

Fill the control with the wanted value, then run the two DoCmd commands.


Vanderghast, Access MVP


"dede" wrote in message
...
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.


  #5  
Old December 1st, 2009, 06:00 PM posted to microsoft.public.access.queries
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Query twice with the same criteria ==

Why are you making tables? You've described 'how' you are trying to solve
some problem, but not the underlying issue.

If you'll provide more specific description of the issue you're working on,
folks here may be able to offer more specific suggestions...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"dede" wrote in message
...
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.



  #6  
Old December 1st, 2009, 06:00 PM posted to microsoft.public.access.queries
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Query twice with the same criteria ==

Why are you making tables? You've described 'how' you are trying to solve
some problem, but not the underlying issue.

If you'll provide more specific description of the issue you're working on,
folks here may be able to offer more specific suggestions...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"dede" wrote in message
...
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.



  #7  
Old December 1st, 2009, 06:00 PM posted to microsoft.public.access.queries
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Query twice with the same criteria ==

Why are you making tables? You've described 'how' you are trying to solve
some problem, but not the underlying issue.

If you'll provide more specific description of the issue you're working on,
folks here may be able to offer more specific suggestions...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"dede" wrote in message
...
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.



  #8  
Old December 1st, 2009, 06:35 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query twice with the same criteria ==

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]
  #9  
Old December 1st, 2009, 06:35 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query twice with the same criteria ==

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]
  #10  
Old December 1st, 2009, 06:35 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query twice with the same criteria ==

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]
 




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 05:42 PM.


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